Merge fx-team to m-c. a=merge

This commit is contained in:
Ryan VanderMeulen 2014-11-07 13:35:28 -05:00
commit 52e83145a1
96 changed files with 677 additions and 547 deletions

View File

@ -1636,17 +1636,7 @@ pref("shumway.disabled", true);
// (This is intentionally on the high side; see bug 746055.)
pref("image.mem.max_decoded_image_kb", 256000);
// Enable by default development builds up until early beta
#ifdef EARLY_BETA_OR_EARLIER
pref("loop.enabled", true);
pref("loop.throttled", false);
#else
pref("loop.enabled", true);
pref("loop.throttled", true);
pref("loop.soft_start_ticket_number", -1);
pref("loop.soft_start_hostname", "soft-start.loop.services.mozilla.com");
#endif
pref("loop.server", "https://loop.services.mozilla.com");
pref("loop.seenToS", "unseen");
pref("loop.learnMoreUrl", "https://www.firefox.com/hello/");

View File

@ -15,7 +15,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "PanelFrame", "resource:///modules/Panel
LoopUI = {
get toolbarButton() {
delete this.toolbarButton;
return this.toolbarButton = CustomizableUI.getWidget("loop-call-button").forWindow(window);
return this.toolbarButton = CustomizableUI.getWidget("loop-button").forWindow(window);
},
/**
@ -44,21 +44,9 @@ XPCOMUtils.defineLazyModuleGetter(this, "PanelFrame", "resource:///modules/Panel
* delayedStartup.
*/
init: function() {
if (!Services.prefs.getBoolPref("loop.enabled")) {
this.toolbarButton.node.hidden = true;
return;
}
// Add observer notifications before the service is initialized
Services.obs.addObserver(this, "loop-status-changed", false);
// If we're throttled, check to see if it's our turn to be unthrottled
if (Services.prefs.getBoolPref("loop.throttled")) {
this.toolbarButton.node.hidden = true;
MozLoopService.checkSoftStart(this.toolbarButton.node);
return;
}
MozLoopService.initialize();
this.updateToolbarState();
},

View File

@ -679,9 +679,9 @@
fullscreentoolbar="true" mode="icons" customizable="true"
iconsize="small"
#ifdef MOZ_DEV_EDITION
defaultset="urlbar-container,search-container,developer-button,bookmarks-menu-button,downloads-button,home-button,loop-call-button"
defaultset="urlbar-container,search-container,developer-button,bookmarks-menu-button,downloads-button,home-button,loop-button"
#else
defaultset="urlbar-container,search-container,bookmarks-menu-button,downloads-button,home-button,loop-call-button"
defaultset="urlbar-container,search-container,bookmarks-menu-button,downloads-button,home-button,loop-button"
#endif
customizationtarget="nav-bar-customization-target"
overflowable="true"

View File

@ -117,7 +117,6 @@ skip-if = os == "linux" || e10s # Bug 1073339 - Investigate autocomplete test un
[browser_action_searchengine_alias.js]
skip-if = os == "linux" || e10s # Bug 1073339 - Investigate autocomplete test unreliability on Linux/e10s
[browser_addKeywordSearch.js]
skip-if = e10s
[browser_search_favicon.js]
skip-if = os == "linux" || e10s # Bug 1073339 - Investigate autocomplete test unreliability on Linux/e10s
[browser_alltabslistener.js]
@ -250,7 +249,6 @@ skip-if = e10s # Bug 1093677 - automated form submission from the test doesn't s
[browser_bug596687.js]
[browser_bug597218.js]
[browser_bug609700.js]
skip-if = e10s # Bug 516755 - SessionStore disabled for e10s (calls duplicateTabIn, which uses SessionStore)
[browser_bug623155.js]
skip-if = e10s # Bug ?????? - URLBar issues (apparently issues with redirection)
[browser_bug623893.js]
@ -263,7 +261,7 @@ skip-if = buildapp == 'mulet' || e10s # Bug 1093373 - Relies on browser.sessionH
skip-if = e10s
[browser_bug664672.js]
[browser_bug676619.js]
skip-if = buildapp == 'mulet' || os == "mac" || e10s # mac: Intermittent failures, bug 925225; e10s: Bug ?????? - test directly manipulates content (event.target.location)
skip-if = buildapp == 'mulet' || os == "mac" # mac: Intermittent failures, bug 925225
[browser_bug678392.js]
skip-if = e10s # Bug ?????? - Obscure non-windows failures ("Snapshot array has correct length of 1 after loading one page. - Got 0, expected 1" and more)
[browser_bug710878.js]
@ -326,7 +324,6 @@ skip-if = e10s
[browser_favicon_change_not_in_document.js]
skip-if = e10s
[browser_findbarClose.js]
skip-if = e10s # Bug ?????? - test directly manipulates content (tries to grab an iframe directly from content)
[browser_fullscreen-window-open.js]
skip-if = buildapp == 'mulet' || e10s || os == "linux" # Bug 933103 - mochitest's EventUtils.synthesizeMouse functions not e10s friendly. Linux: Intermittent failures - bug 941575.
[browser_fxa_oauth.js]
@ -351,7 +348,7 @@ skip-if = os == "linux" || e10s # Linux: Intermittent failures, bug 917535; e10s
[browser_locationBarExternalLoad.js]
skip-if = e10s
[browser_menuButtonFitts.js]
skip-if = os != "win" || e10s # The Fitts Law menu button is only supported on Windows (bug 969376); # Bug ?????? - URL bar issues ("There should be no focused element - Got [object XULElement], expected null")
skip-if = os != "win" # The Fitts Law menu button is only supported on Windows (bug 969376)
[browser_middleMouse_noJSPaste.js]
skip-if = e10s # Bug 921952 - Content:Click event issues
[browser_minimize.js]
@ -477,7 +474,7 @@ skip-if = true # Bug 1005420 - fails intermittently. also with e10s enabled: biz
[browser_visibleTabs_bookmarkAllTabs.js]
[browser_visibleTabs_contextMenu.js]
[browser_visibleTabs_tabPreview.js]
skip-if = (os == "win" && !debug) || e10s # Bug 1007418 / Bug 698371 - thumbnail captures need e10s love (tabPreviews_capture fails with Argument 1 of CanvasRenderingContext2D.drawWindow does not implement interface Window.)
skip-if = (os == "win" && !debug) # Bug 1007418
[browser_web_channel.js]
[browser_windowopen_reflows.js]
skip-if = buildapp == 'mulet'

View File

@ -5,5 +5,5 @@
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>browser_searchSuggestionEngine searchSuggestionEngine.xml</ShortName>
<Url type="application/x-suggestions+json" method="GET" template="http://mochi.test:8888/browser/browser/base/content/test/general/searchSuggestionEngine.sjs?{searchTerms}"/>
<Url type="text/html" method="GET" template="http://browser-searchSuggestionEngine.com/searchSuggestionEngine" rel="searchform"/>
<Url type="text/html" method="GET" template="http://www.browser-searchSuggestionEngine.com/searchSuggestionEngine" rel="searchform"/>
</SearchPlugin>

View File

@ -31,7 +31,6 @@ skip-if = os == "mac" # Intermittent failures, bug 898317
[browser_newtab_reflow_load.js]
support-files =
content-reflows.js
[browser_newtab_reset.js]
[browser_newtab_search.js]
support-files =
searchEngineNoLogo.xml
@ -42,7 +41,6 @@ support-files =
../general/searchSuggestionEngine.xml
../general/searchSuggestionEngine.sjs
[browser_newtab_sponsored_icon_click.js]
[browser_newtab_tabsync.js]
[browser_newtab_undo.js]
[browser_newtab_unpin.js]
[browser_newtab_update.js]

View File

@ -37,6 +37,12 @@ function runTests() {
// for the hidden newtab docshell.
let tab = gWindow.gBrowser.addTab("about:blank");
yield addNewTabPageTab();
// When newtab is loaded very quickly (which is what happens in 99% of cases)
// there is no need to wait so no tests are run. Because each test requires
// either a pass, fail or todo we run a dummy test here.
ok(true, "Each test requires at least one pass, fail or todo so here is a pass.");
let swapWaitCount = 0;
let swapped = imports.BrowserNewTabPreloader.newTab(tab);
while (!swapped) {

View File

@ -28,6 +28,8 @@ function runTests() {
// Clean up.
gBrowser.removeCurrentTab({animate: false});
ok(true, "Each test requires at least one pass, fail or todo so here is a pass.");
}
function whenBrowserLoaded(browser) {

View File

@ -1,28 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/*
* These tests make sure that resetting the 'New Tage Page' works as expected.
*/
function runTests() {
// Disabled until bug 716543 is fixed.
return;
// create a new tab page and check its modified state after blocking a site
yield setLinks("0,1,2,3,4,5,6,7,8");
setPinnedLinks("");
yield addNewTabPageTab();
let resetButton = getContentDocument().getElementById("toolbar-button-reset");
checkGrid("0,1,2,3,4,5,6,7,8");
ok(!resetButton.hasAttribute("modified"), "page is not modified");
yield blockCell(4);
checkGrid("0,1,2,3,5,6,7,8,");
ok(resetButton.hasAttribute("modified"), "page is modified");
yield getContentWindow().gToolbar.reset(TestRunner.next);
checkGrid("0,1,2,3,4,5,6,7,8");
ok(!resetButton.hasAttribute("modified"), "page is not modified");
}

View File

@ -1,61 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/*
* These tests make sure that all changes that are made to a specific
* 'New Tab Page' are synchronized with all other open 'New Tab Pages'
* automatically. All about:newtab pages should always be in the same
* state.
*/
function runTests() {
// Disabled until bug 716543 is fixed.
return;
yield setLinks("0,1,2,3,4,5,6,7,8,9");
setPinnedLinks(",1");
yield addNewTabPageTab();
checkGrid("0,1p,2,3,4,5,6,7,8");
let resetButton = getContentDocument().getElementById("toolbar-button-reset");
ok(!resetButton.hasAttribute("modified"), "page is not modified");
let oldSites = getGrid().sites;
let oldResetButton = resetButton;
// create the new tab page
yield addNewTabPageTab();
checkGrid("0,1p,2,3,4,5,6,7,8");
resetButton = getContentDocument().getElementById("toolbar-button-reset");
ok(!resetButton.hasAttribute("modified"), "page is not modified");
// unpin a cell
yield unpinCell(1);
checkGrid("0,1,2,3,4,5,6,7,8");
checkGrid("0,1,2,3,4,5,6,7,8", oldSites);
// remove a cell
yield blockCell(1);
checkGrid("0,2,3,4,5,6,7,8,9");
checkGrid("0,2,3,4,5,6,7,8,9", oldSites);
ok(resetButton.hasAttribute("modified"), "page is modified");
ok(oldResetButton.hasAttribute("modified"), "page is modified");
// insert a new cell by dragging
yield simulateExternalDrop(1);
checkGrid("0,99p,2,3,4,5,6,7,8");
checkGrid("0,99p,2,3,4,5,6,7,8", oldSites);
// drag a cell around
yield simulateDrop(2, 1);
checkGrid("0,2p,99p,3,4,5,6,7,8");
checkGrid("0,2p,99p,3,4,5,6,7,8", oldSites);
// reset the new tab page
yield getContentWindow().gToolbar.reset(TestRunner.next);
checkGrid("0,1,2,3,4,5,6,7,8");
checkGrid("0,1,2,3,4,5,6,7,8", oldSites);
ok(!resetButton.hasAttribute("modified"), "page is not modified");
ok(!oldResetButton.hasAttribute("modified"), "page is not modified");
}

View File

@ -61,7 +61,7 @@ const kIteratorSymbol = JS_HAS_SYMBOLS ? Symbol.iterator : "@@iterator";
* The current version. We can use this to auto-add new default widgets as necessary.
* (would be const but isn't because of testing purposes)
*/
let kVersion = 1;
let kVersion = 4;
/**
* gPalette is a map of every widget that CustomizableUI.jsm knows about, keyed
@ -217,7 +217,7 @@ let CustomizableUIInternal = {
"bookmarks-menu-button",
"downloads-button",
"home-button",
"loop-call-button",
"loop-button",
];
if (Services.prefs.getBoolPref(kPrefWebIDEInNavbar)) {
@ -315,6 +315,15 @@ let CustomizableUIInternal = {
}
}
}
if (currentVersion < 2) {
// Nuke the old 'loop-call-button' out of orbit.
CustomizableUI.removeWidgetFromArea("loop-call-button");
}
if (currentVersion < 4) {
CustomizableUI.removeWidgetFromArea("loop-button-throttled");
}
},
wrapWidget: function(aWidgetId) {

View File

@ -925,13 +925,18 @@ const CustomizableWidgets = [
win.MailIntegration.sendLinkForWindow(win.content);
}
}, {
id: "loop-call-button",
id: "loop-button",
type: "custom",
label: "loop-call-button3.label",
tooltiptext: "loop-call-button3.tooltiptext",
defaultArea: CustomizableUI.AREA_NAVBAR,
introducedInVersion: 1,
introducedInVersion: 4,
onBuild: function(aDocument) {
// If we're not supposed to see the button, return zip.
if (!Services.prefs.getBoolPref("loop.enabled")) {
return null;
}
let node = aDocument.createElementNS(kNSXUL, "toolbarbutton");
node.setAttribute("id", this.id);
node.classList.add("toolbarbutton-1");
@ -943,6 +948,7 @@ const CustomizableWidgets = [
node.addEventListener("command", function(event) {
aDocument.defaultView.LoopUI.openCallPanel(event);
});
return node;
}
}, {

View File

@ -741,6 +741,9 @@ CustomizeMode.prototype = {
let unusedWidgets = CustomizableUI.getUnusedWidgets(toolboxPalette);
for (let widget of unusedWidgets) {
let paletteItem = this.makePaletteItem(widget, "palette");
if (!paletteItem) {
continue;
}
fragment.appendChild(paletteItem);
}
@ -758,6 +761,15 @@ CustomizeMode.prototype = {
// while still getting rid of the need for overlays.
makePaletteItem: function(aWidget, aPlace) {
let widgetNode = aWidget.forWindow(this.window).node;
if (!widgetNode) {
ERROR("Widget with id " + aWidget.id + " does not return a valid node");
return null;
}
// Do not build a palette item for hidden widgets; there's not much to show.
if (widgetNode.hidden) {
return null;
}
let wrapper = this.createOrUpdateWrapper(widgetNode, aPlace);
wrapper.appendChild(widgetNode);
return wrapper;

View File

@ -10,11 +10,6 @@ const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
// https://github.com/mozilla-services/loop-server/blob/45787d34108e2f0d87d74d4ddf4ff0dbab23501c/loop/errno.json#L6
const INVALID_AUTH_TOKEN = 110;
// Ticket numbers are 24 bits in length.
// The highest valid ticket number is 16777214 (2^24 - 2), so that a "now
// serving" number of 2^24 - 1 is greater than it.
const MAX_SOFT_START_TICKET_NUMBER = 16777214;
const LOOP_SESSION_TYPE = {
GUEST: 1,
FXA: 2,
@ -957,9 +952,15 @@ this.MozLoopService = {
// stub out API functions for unit testing
Object.freeze(this);
// Clear the old throttling mechanism. This code will be removed in bug 1094915,
// should be around Fx 39.
Services.prefs.clearUserPref("loop.throttled");
Services.prefs.clearUserPref("loop.throttled2");
Services.prefs.clearUserPref("loop.soft_start_ticket_number");
Services.prefs.clearUserPref("loop.soft_start_hostname");
// Don't do anything if loop is not enabled.
if (!Services.prefs.getBoolPref("loop.enabled") ||
Services.prefs.getBoolPref("loop.throttled")) {
if (!Services.prefs.getBoolPref("loop.enabled")) {
return Promise.reject("loop is not enabled");
}
@ -1046,104 +1047,6 @@ this.MozLoopService = {
return MozLoopServiceInternal.openChatWindow(conversationWindowData);
},
/**
* If we're operating the service in "soft start" mode, and this browser
* isn't already activated, check whether it's time for it to become active.
* If so, activate the loop service.
*
* @param {Object} buttonNode DOM node representing the Loop button -- if we
* change from inactive to active, we need this
* in order to unhide the Loop button.
* @param {Function} doneCb [optional] Callback that is called when the
* check has completed.
*/
checkSoftStart(buttonNode, doneCb) {
if (!Services.prefs.getBoolPref("loop.throttled")) {
if (typeof(doneCb) == "function") {
doneCb(new Error("Throttling is not active"));
}
return;
}
if (Services.io.offline) {
if (typeof(doneCb) == "function") {
doneCb(new Error("Cannot check soft-start value: browser is offline"));
}
return;
}
let ticket = Services.prefs.getIntPref("loop.soft_start_ticket_number");
if (!ticket || ticket > MAX_SOFT_START_TICKET_NUMBER || ticket < 0) {
// Ticket value isn't valid (probably isn't set up yet) -- pick a random
// number from 1 to MAX_SOFT_START_TICKET_NUMBER, inclusive, and write it
// into prefs.
ticket = Math.floor(Math.random() * MAX_SOFT_START_TICKET_NUMBER) + 1;
// Floating point numbers can be imprecise, so we need to deal with
// the case that Math.random() effectively rounds to 1.0
if (ticket > MAX_SOFT_START_TICKET_NUMBER) {
ticket = MAX_SOFT_START_TICKET_NUMBER;
}
Services.prefs.setIntPref("loop.soft_start_ticket_number", ticket);
}
let onLookupComplete = (request, record, status) => {
// We don't bother checking errors -- if the DNS query fails,
// we just don't activate this time around. We'll check again on
// next startup.
if (!Components.isSuccessCode(status)) {
if (typeof(doneCb) == "function") {
doneCb(new Error("Error in DNS Lookup: " + status));
}
return;
}
let address = record.getNextAddrAsString().split(".");
if (address.length != 4) {
if (typeof(doneCb) == "function") {
doneCb(new Error("Invalid IP address"));
}
return;
}
if (address[0] != 127) {
if (typeof(doneCb) == "function") {
doneCb(new Error("Throttling IP address is not on localhost subnet"));
}
return
}
// Can't use bitwise operations here because JS treats all bitwise
// operations as 32-bit *signed* integers.
let now_serving = ((parseInt(address[1]) * 0x10000) +
(parseInt(address[2]) * 0x100) +
parseInt(address[3]));
if (now_serving > ticket) {
// Hot diggity! It's our turn! Activate the service.
log.info("MozLoopService: Activating Loop via soft-start");
Services.prefs.setBoolPref("loop.throttled", false);
buttonNode.hidden = false;
this.initialize();
}
if (typeof(doneCb) == "function") {
doneCb(null);
}
};
// We use DNS to propagate the slow-start value, since it has well-known
// scaling properties. Ideally, this would use something more semantic,
// like a TXT record; but we don't support TXT in our DNS resolution (see
// Bug 14328), so we instead treat the lowest 24 bits of the IP address
// corresponding to our "slow start DNS name" as a 24-bit integer. To
// ensure that these addresses aren't routable, the highest 8 bits must
// be "127" (reserved for localhost).
let host = Services.prefs.getCharPref("loop.soft_start_hostname");
let task = this._DNSService.asyncResolve(host,
this._DNSService.RESOLVE_DISABLE_IPV6,
onLookupComplete,
Services.tm.mainThread);
},
/**
* @see MozLoopServiceInternal.promiseRegisteredWithServers
*/

View File

@ -47,7 +47,7 @@ class Test1BrowserCall(MarionetteTestCase):
return self.marionette.find_element(by, locator)
def switch_to_panel(self):
button = self.marionette.find_element(By.ID, "loop-call-button")
button = self.marionette.find_element(By.ID, "loop-button")
# click the element
button.click()

View File

@ -18,7 +18,6 @@ skip-if = e10s
[browser_mozLoop_appVersionInfo.js]
[browser_mozLoop_prefs.js]
[browser_mozLoop_doNotDisturb.js]
[browser_mozLoop_softStart.js]
skip-if = buildapp == 'mulet'
[browser_toolbarbutton.js]
[browser_mozLoop_pluralStrings.js]

View File

@ -18,7 +18,7 @@ function* checkFxA401() {
"Check friendlyDetails");
ise(err.friendlyDetailsButtonLabel, getLoopString("retry_button"),
"Check friendlyDetailsButtonLabel");
let loopButton = document.getElementById("loop-call-button");
let loopButton = document.getElementById("loop-button");
is(loopButton.getAttribute("state"), "error",
"state of loop button should be error after a 401 with login");
@ -268,7 +268,7 @@ add_task(function* basicAuthorizationAndRegistration() {
let visibleEmail = loopDoc.getElementsByClassName("user-identity")[0];
is(visibleEmail.textContent, "Guest", "Guest should be displayed on the panel when not logged in");
is(MozLoopService.userProfile, null, "profile should be null before log-in");
let loopButton = document.getElementById("loop-call-button");
let loopButton = document.getElementById("loop-button");
is(loopButton.getAttribute("state"), "", "state of loop button should be empty when not logged in");
info("Login");

View File

@ -1,135 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
const SOFT_START_HOSTNAME = "soft-start.example.invalid";
let MockDNSService = {
RESOLVE_DISABLE_IPV6: 32,
nowServing: 0,
resultCode: 0,
ipFirstOctet: 127,
getNowServingAddress: function() {
let ip = this.ipFirstOctet + "." +
((this.nowServing >>> 16) & 0xFF) + "." +
((this.nowServing >>> 8) & 0xFF) + "." +
((this.nowServing) & 0xFF);
info("Using 'now serving' of " + this.nowServing + " (" + ip + ")");
return ip;
},
asyncResolve: function(host, flags, callback) {
let mds = this;
Assert.equal(flags, this.RESOLVE_DISABLE_IPV6,
"AAAA lookup should be disabled");
Assert.equal(host, SOFT_START_HOSTNAME,
"Configured hostname should be used");
callback(null,
{getNextAddrAsString: mds.getNowServingAddress.bind(mds)},
this.resultCode);
}
};
// We need an unfrozen copy of the LoopService so we can monkeypatch it.
let LoopService = {};
for (var prop in MozLoopService) {
if (MozLoopService.hasOwnProperty(prop)) {
LoopService[prop] = MozLoopService[prop];
}
}
LoopService._DNSService = MockDNSService;
let MockButton = {
hidden: true
};
let runCheck = function(expectError) {
return new Promise((resolve, reject) => {
LoopService.checkSoftStart(MockButton, error => {
if ((!!error) != (!!expectError)) {
reject(error);
} else {
resolve(error);
}
})
});
}
add_task(function* test_mozLoop_softStart() {
let orig_throttled = Services.prefs.getBoolPref("loop.throttled");
// Set associated variables to proper values
Services.prefs.setBoolPref("loop.throttled", true);
Services.prefs.setCharPref("loop.soft_start_hostname", SOFT_START_HOSTNAME);
Services.prefs.setIntPref("loop.soft_start_ticket_number", -1);
registerCleanupFunction(function () {
Services.prefs.setBoolPref("loop.throttled", orig_throttled);
Services.prefs.clearUserPref("loop.soft_start_ticket_number");
Services.prefs.clearUserPref("loop.soft_start_hostname");
});
let throttled;
let ticket;
info("Ensure that we pick a valid ticket number.");
yield runCheck();
throttled = Services.prefs.getBoolPref("loop.throttled");
ticket = Services.prefs.getIntPref("loop.soft_start_ticket_number");
Assert.equal(MockButton.hidden, true, "Button should still be hidden");
Assert.equal(throttled, true, "Feature should still be throttled");
Assert.notEqual(ticket, -1, "Ticket should be changed");
Assert.ok((ticket < 16777214 && ticket > 0), "Ticket should be in range");
// Try some "interesting" ticket numbers
for (ticket of [1, 256, 65535, 10000000, 16777214]) {
MockButton.hidden = true;
Services.prefs.setBoolPref("loop.throttled", true);
Services.prefs.setIntPref("loop.soft_start_ticket_number", ticket);
info("Ensure that we don't activate when the now serving " +
"number is less than our value.");
MockDNSService.nowServing = ticket - 1;
yield runCheck();
throttled = Services.prefs.getBoolPref("loop.throttled");
Assert.equal(MockButton.hidden, true, "Button should still be hidden");
Assert.equal(throttled, true, "Feature should still be throttled");
info("Ensure that we don't activate when the now serving " +
"number is equal to our value");
MockDNSService.nowServing = ticket;
yield runCheck();
throttled = Services.prefs.getBoolPref("loop.throttled");
Assert.equal(MockButton.hidden, true, "Button should still be hidden");
Assert.equal(throttled, true, "Feature should still be throttled");
info("Ensure that we *do* activate when the now serving " +
"number is greater than our value");
MockDNSService.nowServing = ticket + 1;
yield runCheck();
throttled = Services.prefs.getBoolPref("loop.throttled");
Assert.equal(MockButton.hidden, false, "Button should not be hidden");
Assert.equal(throttled, false, "Feature should be unthrottled");
}
info("Check DNS error behavior");
MockDNSService.nowServing = 0;
MockDNSService.resultCode = 0x80000000;
Services.prefs.setBoolPref("loop.throttled", true);
MockButton.hidden = true;
yield runCheck(true);
throttled = Services.prefs.getBoolPref("loop.throttled");
Assert.equal(MockButton.hidden, true, "Button should be hidden");
Assert.equal(throttled, true, "Feature should be throttled");
info("Check DNS misconfiguration behavior");
MockDNSService.nowServing = ticket + 1;
MockDNSService.resultCode = 0;
MockDNSService.ipFirstOctet = 6;
Services.prefs.setBoolPref("loop.throttled", true);
MockButton.hidden = true;
yield runCheck(true);
throttled = Services.prefs.getBoolPref("loop.throttled");
Assert.equal(MockButton.hidden, true, "Button should be hidden");
Assert.equal(throttled, true, "Feature should be throttled");
});

View File

@ -19,7 +19,7 @@ var gMozLoopAPI;
function promiseGetMozLoopAPI() {
return new Promise((resolve, reject) => {
let loopPanel = document.getElementById("loop-notification-panel");
let btn = document.getElementById("loop-call-button");
let btn = document.getElementById("loop-button");
// Wait for the popup to be shown if it's not already, then we can get the iframe and
// wait for the iframe's load to be completed.

View File

@ -29,7 +29,6 @@ var loopServer;
// Ensure loop is always enabled for tests
Services.prefs.setBoolPref("loop.enabled", true);
Services.prefs.setBoolPref("loop.throttled", false);
// Cleanup function for all tests
do_register_cleanup(() => {

View File

@ -856,6 +856,10 @@ BrowserGlue.prototype = {
// All initial windows have opened.
_onWindowsRestored: function BG__onWindowsRestored() {
#ifdef MOZ_DEV_EDITION
this._createExtraDefaultProfile();
#endif
this._initServiceDiscovery();
// Show update notification, if needed.
@ -927,6 +931,39 @@ BrowserGlue.prototype = {
#endif
},
#ifdef MOZ_DEV_EDITION
_createExtraDefaultProfile: function () {
// If Developer Edition is the only installed Firefox version and no other
// profiles are present, create a second one for use by other versions.
// This helps Firefox versions earlier than 35 avoid accidentally using the
// unsuitable Developer Edition profile.
let profileService = Cc["@mozilla.org/toolkit/profile-service;1"]
.getService(Ci.nsIToolkitProfileService);
let profileCount = profileService.profileCount;
if (profileCount == 1 && profileService.selectedProfile.name != "default") {
let newProfile;
try {
newProfile = profileService.createProfile(null, "default");
profileService.defaultProfile = newProfile;
profileService.flush();
} catch (e) {
Cu.reportError("Could not create profile 'default': " + e);
}
if (newProfile) {
// We don't want a default profile with Developer Edition settings, an
// empty profile directory will do. The profile service of the other
// Firefox will populate it with its own stuff.
let newProfilePath = newProfile.rootDir.path;
OS.File.removeDir(newProfilePath).then(() => {
return OS.File.makeDir(newProfilePath);
}).then(null, e => {
Cu.reportError("Could not empty profile 'default': " + e);
});
}
}
},
#endif
_onQuitRequest: function BG__onQuitRequest(aCancelQuit, aQuitType) {
// If user has already dismissed quit request, then do nothing
if ((aCancelQuit instanceof Ci.nsISupportsPRBool) && aCancelQuit.data)

View File

@ -48,6 +48,10 @@ function test() {
iframe.setAttribute("src", "about:mozilla");
});
});
// This test relies on the test timing out in order to indicate failure so
// let's add a dummy pass.
ok(true, "Each test requires at least one pass, fail or todo so here is a pass.");
}
function whenChildCount(aEntry, aChildCount, aCallback) {

View File

@ -2,3 +2,4 @@
[browser_420786.js]
[browser_633221.js]
run-if = os == "linux"

View File

@ -18,4 +18,8 @@ function test() {
EventUtils.synthesizeMouseAtCenter(button, {}, cw);
}, cw);
});
// This test relies on the test timing out in order to indicate failure so
// let's add a dummy pass.
ok(true, "Each test requires at least one pass, fail or todo so here is a pass.");
}

View File

@ -90,6 +90,7 @@ skip-if = true || e10s # Disabled until TZ bug is fixed
[browser_gcli_history.js]
[browser_gcli_incomplete.js]
[browser_gcli_inputter.js]
skip-if = true # Bug 1093205 - Test does not run in Firefox due to missing terminal bug
[browser_gcli_intro.js]
[browser_gcli_js.js]
[browser_gcli_keyboard1.js]
@ -105,5 +106,6 @@ skip-if = true || e10s # Disabled until TZ bug is fixed
[browser_gcli_split.js]
[browser_gcli_tokenize.js]
[browser_gcli_tooltip.js]
skip-if = true # Bug 1093205 - Test does not run in Firefox due to missing terminal
[browser_gcli_types.js]
[browser_gcli_union.js]

View File

@ -1170,6 +1170,11 @@ helpers.audit = function(options, audits) {
'due to ' + audit.skipRemainingIf.name :
'';
assert.log('Skipped ' + name + ' ' + skipReason);
// Tests need at least one pass, fail or todo. Let's create a dummy pass
// in case there are none.
ok(true, "Each test requires at least one pass, fail or todo so here is a pass.");
return Promise.resolve(undefined);
}
}

View File

@ -39,6 +39,7 @@ skip-if = e10s # Bug 1069044 - destroyInspector may hang during shutdown
[browser_toolbox_tool_remote_reopen.js]
[browser_toolbox_window_reload_target.js]
[browser_toolbox_window_shortcuts.js]
skip-if = os == "mac" && os_version == "10.8" || os == "win" && os_version == "5.1" # Bug 851129 - Re-enable browser_toolbox_window_shortcuts.js test after leaks are fixed
[browser_toolbox_window_title_changes.js]
[browser_toolbox_zoom.js]
[browser_toolbox_custom_host.js]

View File

@ -6,12 +6,6 @@ let Toolbox = devtools.Toolbox;
let toolbox, toolIDs, idIndex, modifiedPrefs = [];
function test() {
if (window.navigator.userAgent.indexOf("Mac OS X 10.8") != -1 ||
window.navigator.userAgent.indexOf("Windows NT 5.1") != -1) {
info("Skipping Mac OSX 10.8 and Windows xp, see bug 838069");
finish();
return;
}
addTab("about:blank").then(function() {
toolIDs = [];
for (let [id, definition] of gDevTools._tools) {

View File

@ -13,6 +13,8 @@ function ifWebGLSupported() {
ok(false, "A 'program-linked' notification shouldn't have been sent!");
});
ok(true, "Each test requires at least one pass, fail or todo so here is a pass.");
yield reload(target);
yield removeTab(target.tab);
finish();

View File

@ -9,6 +9,7 @@ support-files = head.js
[browser_tilt_02_notifications-tabs.js]
[browser_tilt_02_notifications.js]
[browser_tilt_03_tab_switch.js]
skip-if = true # Bug 1093215 - Failed assertion
[browser_tilt_04_initialization.js]
[browser_tilt_05_destruction-esc.js]
[browser_tilt_05_destruction-url.js]

View File

@ -6,10 +6,12 @@ let tabEvents = "";
function test() {
if (!isTiltEnabled()) {
aborting();
info("Skipping notifications test because Tilt isn't enabled.");
return;
}
if (!isWebGLSupported()) {
aborting();
info("Skipping notifications test because WebGL isn't supported.");
return;
}
@ -29,7 +31,7 @@ function test() {
info("Starting up the Tilt notifications test.");
createTilt({}, false, function suddenDeath()
{
info("Tilt could not be initialized properly.");
ok(false, "Tilt could not be initialized properly.");
cleanup();
});
});
@ -74,10 +76,6 @@ function obs_DESTROYED(win) {
}
function finalize(win) {
if (!tabEvents) {
return;
}
is(win, gBrowser.selectedBrowser.contentWindow, "Saw the correct window");
is(tabEvents, "STARTUP;INITIALIZING;INITIALIZED;DESTROYING;BEFORE_DESTROYED;DESTROYED;",
"The notifications weren't fired in the correct order.");

View File

@ -35,10 +35,12 @@ function after(notification, callback) {
function test() {
if (!isTiltEnabled()) {
aborting();
info("Skipping tab switch test because Tilt isn't enabled.");
return;
}
if (!isWebGLSupported()) {
aborting();
info("Skipping tab switch test because WebGL isn't supported.");
return;
}
@ -71,7 +73,7 @@ let testSteps = [
createTilt({}, false, function suddenDeath()
{
info("Tilt could not be initialized properly.");
ok(false, "Tilt could not be initialized properly.");
cleanup();
});
});
@ -87,7 +89,7 @@ let testSteps = [
createTilt({}, false, function suddenDeath()
{
info("Tilt could not be initialized properly.");
ok(false, "Tilt could not be initialized properly.");
cleanup();
});
});

View File

@ -8,10 +8,12 @@ let tabEvents = "";
function test() {
if (!isTiltEnabled()) {
aborting();
info("Skipping notifications test because Tilt isn't enabled.");
return;
}
if (!isWebGLSupported()) {
aborting();
info("Skipping notifications test because WebGL isn't supported.");
return;
}
@ -43,7 +45,7 @@ function createNewTab() {
}
}, false, function suddenDeath()
{
info("Tilt could not be initialized properly.");
ok(false, "Tilt could not be initialized properly.");
cleanup();
});
});
@ -95,10 +97,6 @@ let testSteps = [
];
function finalize(win) {
if (!tabEvents) {
return;
}
is(win, tab1.linkedBrowser.contentWindow, "Saw the correct window");
is(tabEvents, "STARTUP;INITIALIZING;HIDDEN;SHOWN;DESTROYING;",

View File

@ -6,6 +6,10 @@ let tab0, tab1, tab2;
let testStep = -1;
function test() {
// This test relies on a timeout to indicate pass or fail. All tests need at
// least one pass, fail or todo so let's create a dummy pass.
ok(true, "Each test requires at least one pass, fail or todo so here is a pass.");
if (!isTiltEnabled()) {
info("Skipping tab switch test because Tilt isn't enabled.");
return;
@ -32,7 +36,7 @@ function createTab1() {
}
}, false, function suddenDeath()
{
info("Tilt could not be initialized properly.");
ok(false, "Tilt could not be initialized properly.");
cleanup();
});
});
@ -49,7 +53,7 @@ function createTab2() {
}
}, false, function suddenDeath()
{
info("Tilt could not be initialized properly.");
ok(false, "Tilt could not be initialized properly.");
cleanup();
});
});

View File

@ -4,10 +4,12 @@
function test() {
if (!isTiltEnabled()) {
aborting();
info("Skipping initialization test because Tilt isn't enabled.");
return;
}
if (!isWebGLSupported()) {
aborting();
info("Skipping initialization test because WebGL isn't supported.");
return;
}
@ -45,7 +47,7 @@ function test() {
}
}, true, function suddenDeath()
{
info("Tilt could not be initialized properly.");
ok(false, "Tilt could not be initialized properly.");
cleanup();
});
});

View File

@ -6,10 +6,12 @@ let tiltOpened = false;
function test() {
if (!isTiltEnabled()) {
aborting();
info("Skipping destruction test because Tilt isn't enabled.");
return;
}
if (!isWebGLSupported()) {
aborting();
info("Skipping destruction test because WebGL isn't supported.");
return;
}
@ -27,7 +29,7 @@ function test() {
}
}, false, function suddenDeath()
{
info("Tilt could not be initialized properly.");
ok(false, "Tilt could not be initialized properly.");
cleanup();
});
});

View File

@ -6,10 +6,12 @@ let tiltOpened = false;
function test() {
if (!isTiltEnabled()) {
aborting();
info("Skipping destruction test because Tilt isn't enabled.");
return;
}
if (!isWebGLSupported()) {
aborting();
info("Skipping destruction test because WebGL isn't supported.");
return;
}
@ -27,7 +29,7 @@ function test() {
}
}, false, function suddenDeath()
{
info("Tilt could not be initialized properly.");
ok(false, "Tilt could not be initialized properly.");
cleanup();
});
});

View File

@ -6,10 +6,12 @@ let tiltOpened = false;
function test() {
if (!isTiltEnabled()) {
aborting();
info("Skipping destruction test because Tilt isn't enabled.");
return;
}
if (!isWebGLSupported()) {
aborting();
info("Skipping destruction test because WebGL isn't supported.");
return;
}
@ -27,7 +29,7 @@ function test() {
}
}, false, function suddenDeath()
{
info("Tilt could not be initialized properly.");
ok(false, "Tilt could not be initialized properly.");
cleanup();
});
});

View File

@ -6,10 +6,12 @@ let tiltOpened = false;
function test() {
if (!isTiltEnabled()) {
aborting();
info("Skipping part of the arcball test because Tilt isn't enabled.");
return;
}
if (!isWebGLSupported()) {
aborting();
info("Skipping part of the arcball test because WebGL isn't supported.");
return;
}
@ -36,7 +38,7 @@ function test() {
}
}, false, function suddenDeath()
{
info("Tilt could not be initialized properly.");
ok(false, "Tilt could not be initialized properly.");
cleanup();
});
});
@ -46,7 +48,6 @@ function performTest(canvas, arcball, callback) {
is(document.activeElement, canvas,
"The visualizer canvas should be focused when performing this test.");
info("Starting arcball reset test.");
// start translating and rotating sometime at random

View File

@ -6,10 +6,12 @@ let tiltOpened = false;
function test() {
if (!isTiltEnabled()) {
aborting();
info("Skipping part of the arcball test because Tilt isn't enabled.");
return;
}
if (!isWebGLSupported()) {
aborting();
info("Skipping part of the arcball test because WebGL isn't supported.");
return;
}
@ -34,7 +36,7 @@ function test() {
}
}, false, function suddenDeath()
{
info("Tilt could not be initialized properly.");
ok(false, "Tilt could not be initialized properly.");
cleanup();
});
});
@ -44,7 +46,6 @@ function performTest(canvas, arcball, callback) {
is(document.activeElement, canvas,
"The visualizer canvas should be focused when performing this test.");
info("Starting arcball reset test.");
// start translating and rotating sometime at random

View File

@ -4,10 +4,12 @@
function test() {
if (!isTiltEnabled()) {
aborting();
info("Skipping controller test because Tilt isn't enabled.");
return;
}
if (!isWebGLSupported()) {
aborting();
info("Skipping controller test because WebGL isn't supported.");
return;
}
@ -122,7 +124,7 @@ function test() {
}
}, true, function suddenDeath()
{
info("Tilt could not be initialized properly.");
ok(false, "Tilt could not be initialized properly.");
cleanup();
});
});

View File

@ -14,6 +14,7 @@ function onWebGLSuccess() {
function test() {
if (!isWebGLSupported()) {
aborting();
info("Skipping tilt_gl01 because WebGL isn't supported on this hardware.");
return;
}
@ -24,6 +25,7 @@ function test() {
let gl = renderer.context;
if (!isWebGLAvailable) {
aborting();
return;
}

View File

@ -14,6 +14,7 @@ function onWebGLSuccess() {
function test() {
if (!isWebGLSupported()) {
aborting();
info("Skipping tilt_gl02 because WebGL isn't supported on this hardware.");
return;
}
@ -24,6 +25,7 @@ function test() {
let gl = renderer.context;
if (!isWebGLAvailable) {
aborting();
return;
}

View File

@ -14,6 +14,7 @@ function onWebGLSuccess() {
function test() {
if (!isWebGLSupported()) {
aborting();
info("Skipping tilt_gl03 because WebGL isn't supported on this hardware.");
return;
}
@ -24,6 +25,7 @@ function test() {
let gl = renderer.context;
if (!isWebGLAvailable) {
aborting();
return;
}

View File

@ -14,6 +14,7 @@ function onWebGLSuccess() {
function test() {
if (!isWebGLSupported()) {
aborting();
info("Skipping tilt_gl04 because WebGL isn't supported on this hardware.");
return;
}
@ -24,6 +25,7 @@ function test() {
let gl = renderer.context;
if (!isWebGLAvailable) {
aborting();
return;
}

View File

@ -14,6 +14,7 @@ function onWebGLSuccess() {
function test() {
if (!isWebGLSupported()) {
aborting();
info("Skipping tilt_gl05 because WebGL isn't supported on this hardware.");
return;
}
@ -24,6 +25,7 @@ function test() {
let gl = renderer.context;
if (!isWebGLAvailable) {
aborting();
return;
}

View File

@ -14,6 +14,7 @@ function onWebGLSuccess() {
function test() {
if (!isWebGLSupported()) {
aborting();
info("Skipping tilt_gl06 because WebGL isn't supported on this hardware.");
return;
}
@ -24,6 +25,7 @@ function test() {
let gl = renderer.context;
if (!isWebGLAvailable) {
aborting();
return;
}

View File

@ -14,6 +14,7 @@ function onWebGLSuccess() {
function test() {
if (!isWebGLSupported()) {
aborting();
info("Skipping tilt_gl07 because WebGL isn't supported on this hardware.");
return;
}
@ -24,6 +25,7 @@ function test() {
let gl = renderer.context;
if (!isWebGLAvailable) {
aborting();
return;
}

View File

@ -14,6 +14,7 @@ function onWebGLSuccess() {
function test() {
if (!isWebGLSupported()) {
aborting();
info("Skipping tilt_gl08 because WebGL isn't supported on this hardware.");
return;
}
@ -24,6 +25,7 @@ function test() {
let gl = renderer.context;
if (!isWebGLAvailable) {
aborting();
return;
}

View File

@ -6,10 +6,12 @@ let pickDone = false;
function test() {
if (!isTiltEnabled()) {
aborting();
info("Skipping picking test because Tilt isn't enabled.");
return;
}
if (!isWebGLSupported()) {
aborting();
info("Skipping picking test because WebGL isn't supported.");
return;
}
@ -41,7 +43,7 @@ function test() {
}
}, false, function suddenDeath()
{
info("Tilt could not be initialized properly.");
ok(false, "Tilt could not be initialized properly.");
cleanup();
});
});

View File

@ -7,10 +7,12 @@ let presenter;
function test() {
if (!isTiltEnabled()) {
aborting();
info("Skipping picking delete test because Tilt isn't enabled.");
return;
}
if (!isWebGLSupported()) {
aborting();
info("Skipping picking delete test because WebGL isn't supported.");
return;
}
@ -43,7 +45,7 @@ function test() {
}
}, false, function suddenDeath()
{
info("Tilt could not be initialized properly.");
ok(false, "Tilt could not be initialized properly.");
cleanup();
});
});

View File

@ -7,10 +7,12 @@ let presenter;
function test() {
if (!isTiltEnabled()) {
aborting();
info("Skipping highlight test because Tilt isn't enabled.");
return;
}
if (!isWebGLSupported()) {
aborting();
info("Skipping highlight test because WebGL isn't supported.");
return;
}
@ -34,7 +36,7 @@ function test() {
}
}, false, function suddenDeath()
{
info("Tilt could not be initialized properly.");
ok(false, "Tilt could not be initialized properly.");
cleanup();
});
});

View File

@ -7,10 +7,12 @@ let presenter;
function test() {
if (!isTiltEnabled()) {
aborting();
info("Skipping highlight test because Tilt isn't enabled.");
return;
}
if (!isWebGLSupported()) {
aborting();
info("Skipping highlight test because WebGL isn't supported.");
return;
}
@ -34,7 +36,7 @@ function test() {
}
}, false, function suddenDeath()
{
info("Tilt could not be initialized properly.");
ok(false, "Tilt could not be initialized properly.");
cleanup();
});
});

View File

@ -7,10 +7,12 @@ let presenter;
function test() {
if (!isTiltEnabled()) {
aborting();
info("Skipping highlight test because Tilt isn't enabled.");
return;
}
if (!isWebGLSupported()) {
aborting();
info("Skipping highlight test because WebGL isn't supported.");
return;
}
@ -31,7 +33,7 @@ function test() {
}
}, false, function suddenDeath()
{
info("Tilt could not be initialized properly.");
ok(false, "Tilt could not be initialized properly.");
cleanup();
});
});

View File

@ -7,10 +7,12 @@ let presenter;
function test() {
if (!isTiltEnabled()) {
aborting();
info("Skipping highlight test because Tilt isn't enabled.");
return;
}
if (!isWebGLSupported()) {
aborting();
info("Skipping highlight test because WebGL isn't supported.");
return;
}
@ -31,7 +33,7 @@ function test() {
}
}, false, function suddenDeath()
{
info("Tilt could not be initialized properly.");
ok(false, "Tilt could not be initialized properly.");
cleanup();
});
});

View File

@ -6,10 +6,12 @@ let presenter;
function test() {
if (!isTiltEnabled()) {
aborting();
info("Skipping highlight test because Tilt isn't enabled.");
return;
}
if (!isWebGLSupported()) {
aborting();
info("Skipping highlight test because WebGL isn't supported.");
return;
}
@ -33,7 +35,7 @@ function test() {
}
}, false, function suddenDeath()
{
info("Tilt could not be initialized properly.");
ok(false, "Tilt could not be initialized properly.");
cleanup();
});
});

View File

@ -7,10 +7,12 @@ let presenter;
function test() {
if (!isTiltEnabled()) {
aborting();
info("Skipping highlight test because Tilt isn't enabled.");
return;
}
if (!isWebGLSupported()) {
aborting();
info("Skipping highlight test because WebGL isn't supported.");
return;
}
@ -34,7 +36,7 @@ function test() {
}
}, false, function suddenDeath()
{
info("Tilt could not be initialized properly.");
ok(false, "Tilt could not be initialized properly.");
cleanup();
});
});

View File

@ -4,10 +4,12 @@
function test() {
if (!isTiltEnabled()) {
aborting();
info("Skipping notifications test because Tilt isn't enabled.");
return;
}
if (!isWebGLSupported()) {
aborting();
info("Skipping visualizer test because WebGL isn't supported.");
return;
}

View File

@ -8,10 +8,12 @@ let tiltOpened = false;
function test() {
if (!isTiltEnabled()) {
aborting();
info("Skipping controller test because Tilt isn't enabled.");
return;
}
if (!isWebGLSupported()) {
aborting();
info("Skipping controller test because WebGL isn't supported.");
return;
}
@ -78,7 +80,7 @@ function test() {
}
}, false, function suddenDeath()
{
info("Tilt could not be initialized properly.");
ok(false, "Tilt could not be initialized properly.");
cleanup();
});
});

View File

@ -13,7 +13,6 @@ let tempScope = {};
Components.utils.import("resource://gre/modules/devtools/LayoutHelpers.jsm", tempScope);
let LayoutHelpers = tempScope.LayoutHelpers;
const DEFAULT_HTML = "data:text/html," +
"<DOCTYPE html>" +
"<html>" +
@ -208,3 +207,9 @@ function getPickablePoint(presenter) {
return vec3.project(center, viewport, renderer.mvMatrix, renderer.projMatrix);
}
function aborting() {
// Tilt aborting and we need at least one pass, fail or todo so let's add a
// dummy pass.
ok(true, "Test aborted early.");
}

View File

@ -20,12 +20,15 @@ function spawnTest () {
"ChannelSplitterNode", "ChannelMergerNode", "DynamicsCompressorNode", "OscillatorNode"
];
nodeTypes.forEach(function (type, i) {
// For some reason nodeTypes.forEach and params.forEach fail here so we use
// simple for loops.
for (let i = 0; i < nodeTypes.length; i++) {
let type = nodeTypes[i];
let params = allNodeParams[i];
params.forEach(function ({param, value, flags}) {
let testFlags = yield nodes[i].getParamFlag(param);
ok(typeof testFlags === "object", type + " has flags from #getParamFlag(" + param + ")");
for (let {param, value, flags} of params) {
let testFlags = yield nodes[i].getParamFlags(param);
ok(typeof testFlags === "object", type + " has flags from #getParamFlags(" + param + ")");
if (param === "buffer") {
is(flags.Buffer, true, "`buffer` params have Buffer flag");
@ -38,8 +41,8 @@ function spawnTest () {
} else {
is(Object.keys(flags), 0, type + "-" + param + " has no flags set")
}
});
});
}
}
yield removeTab(target.tab);
finish();

View File

@ -84,6 +84,7 @@ support-files =
test-console-output-events.html
test-console-column.html
test-consoleiframes.html
test-certificate-messages.html
test-data.json
test-data.json^headers^
test-duplicate-error.html
@ -266,6 +267,7 @@ skip-if = buildapp == 'mulet'
[browser_webconsole_bug_915141_toggle_response_logging_with_keyboard.js]
[browser_webconsole_bug_1006027_message_timestamps_incorrect.js]
[browser_webconsole_bug_1010953_cspro.js]
[browser_webconsole_certificate_messages.js]
[browser_webconsole_cached_autocomplete.js]
[browser_webconsole_change_font_size.js]
[browser_webconsole_chrome.js]

View File

@ -0,0 +1,73 @@
/* vim:set ts=2 sw=2 sts=2 et: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Tests that the Web Console shows SHA-1 Certificate warnings
const TEST_BAD_URI = "https://sha1ee.example.com/browser/browser/devtools/webconsole/test/test-certificate-messages.html";
const TEST_GOOD_URI = "https://sha256ee.example.com/browser/browser/devtools/webconsole/test/test-certificate-messages.html";
const TRIGGER_MSG = "If you haven't seen ssl warnings yet, you won't";
let gHud = undefined;
function test() {
registerCleanupFunction(function () {
gHud = null;
});
addTab("data:text/html;charset=utf8,Web Console SHA-1 warning test");
browser.addEventListener("load", function _onLoad() {
browser.removeEventListener("load", _onLoad, true);
openConsole(null, loadBadDocument);
}, true);
}
function loadBadDocument(theHud) {
gHud = theHud;
browser.addEventListener("load", onBadLoad, true);
content.location = TEST_BAD_URI;
}
function onBadLoad(aEvent) {
browser.removeEventListener("load", onBadLoad, true);
testForWarningMessage();
}
function loadGoodDocument(theHud) {
gHud.jsterm.clearOutput()
browser.addEventListener("load", onGoodLoad, true);
content.location = TEST_GOOD_URI;
}
function onGoodLoad(aEvent) {
browser.removeEventListener("load", onGoodLoad, true);
testForNoWarning();
}
function testForWarningMessage() {
let aOutputNode = gHud.outputNode;
waitForSuccess({
name: "SHA1 warning displayed successfully",
validatorFn: function() {
return gHud.outputNode.textContent.indexOf("SHA-1") > -1;
},
successFn: loadGoodDocument,
failureFn: finishTest,
});
}
function testForNoWarning() {
let aOutputNode = gHud.outputNode;
waitForSuccess({
name: "SHA1 warning appropriately missed",
validatorFn: function() {
if (gHud.outputNode.textContent.indexOf(TRIGGER_MSG) > -1) {
return gHud.outputNode.textContent.indexOf("SHA-1") == -1;
}
},
successFn: finishTest,
failureFn: finishTest,
});
}

View File

@ -0,0 +1,20 @@
<!--
Bug 1068949 - Log crypto warnings to the security pane in the webconsole
-->
<!DOCTYPE HTML>
<html dir="ltr" xml:lang="en-US" lang="en-US">
<head>
<meta charset="utf8">
<title>Security warning test - no violations</title>
<script>
console.log("If you haven't seen ssl warnings yet, you won't");
</script>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
</head>
<body>
</body>
</html>

View File

@ -44,6 +44,8 @@ const INSECURE_PASSWORDS_LEARN_MORE = "https://developer.mozilla.org/docs/Securi
const STRICT_TRANSPORT_SECURITY_LEARN_MORE = "https://developer.mozilla.org/docs/Security/HTTP_Strict_Transport_Security";
const WEAK_SIGNATURE_ALGORITHM_LEARN_MORE = "https://developer.mozilla.org/docs/Security/Weak_Signature_Algorithm";
const HELP_URL = "https://developer.mozilla.org/docs/Tools/Web_Console/Helpers";
const VARIABLES_VIEW_URL = "chrome://browser/content/devtools/widgets/VariablesView.xul";
@ -1597,6 +1599,9 @@ WebConsoleFrame.prototype = {
case "Invalid HSTS Headers":
url = STRICT_TRANSPORT_SECURITY_LEARN_MORE;
break;
case "SHA-1 Signature":
url = WEAK_SIGNATURE_ALGORITHM_LEARN_MORE;
break;
default:
// Unknown category. Return without adding more info node.
return;
@ -4689,6 +4694,7 @@ var Utils = {
case "CSP":
case "Invalid HSTS Headers":
case "Invalid HPKP Headers":
case "SHA-1 Signature":
case "Insecure Password Field":
case "SSL":
case "CORS":

View File

@ -100,7 +100,7 @@ this.UITour = {
}],
["help", {query: "#PanelUI-help"}],
["home", {query: "#home-button"}],
["loop", {query: "#loop-call-button"}],
["loop", {query: "#loop-button"}],
["devtools", {query: "#developer-button"}],
["webide", {query: "#webide-button"}],
["forget", {

View File

@ -1426,73 +1426,73 @@ toolbar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker > .dropmarker-ic
-moz-image-region: rect(0px, 192px, 32px, 160px);
}
#loop-call-button > .toolbarbutton-badge-container {
#loop-button > .toolbarbutton-badge-container {
list-style-image: url("chrome://browser/skin/loop/toolbar@2x.png");
-moz-image-region: rect(0, 36px, 36px, 0);
}
toolbar[brighttext] #loop-call-button > .toolbarbutton-badge-container {
toolbar[brighttext] #loop-button > .toolbarbutton-badge-container {
list-style-image: url("chrome://browser/skin/loop/toolbar-inverted@2x.png");
}
#loop-call-button[state="disabled"] > .toolbarbutton-badge-container,
#loop-call-button[disabled="true"] > .toolbarbutton-badge-container {
#loop-button[state="disabled"] > .toolbarbutton-badge-container,
#loop-button[disabled="true"] > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 72px, 36px, 36px);
}
#loop-call-button:not([disabled="true"])[state="error"] > .toolbarbutton-badge-container {
#loop-button:not([disabled="true"])[state="error"] > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 108px, 36px, 72px);
}
#loop-call-button:not([disabled="true"])[state="action"] > .toolbarbutton-badge-container {
#loop-button:not([disabled="true"])[state="action"] > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 144px, 36px, 108px);
}
#loop-call-button:not([disabled="true"])[state="action"]:-moz-any(:hover,:hover:active,[open]) > .toolbarbutton-badge-container {
#loop-button:not([disabled="true"])[state="action"]:-moz-any(:hover,:hover:active,[open]) > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 180px, 36px, 144px);
}
#loop-call-button:not([disabled="true"])[state="active"] > .toolbarbutton-badge-container {
#loop-button:not([disabled="true"])[state="active"] > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 216px, 36px, 180px);
}
#loop-call-button:not([disabled="true"])[state="active"]:-moz-any(:hover,:hover:active,[open]) > .toolbarbutton-badge-container {
#loop-button:not([disabled="true"])[state="active"]:-moz-any(:hover,:hover:active,[open]) > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 252px, 36px, 216px);
}
#loop-call-button[cui-areatype="menu-panel"] > .toolbarbutton-badge-container,
toolbarpaletteitem[place="palette"] > #loop-call-button > .toolbarbutton-badge-container {
#loop-button[cui-areatype="menu-panel"] > .toolbarbutton-badge-container,
toolbarpaletteitem[place="palette"] > #loop-button > .toolbarbutton-badge-container {
list-style-image: url(chrome://browser/skin/loop/menuPanel@2x.png);
-moz-image-region: rect(0, 64px, 64px, 0);
}
/* Make sure that the state icons are not shown in the customization palette. */
toolbarpaletteitem[place="palette"] > #loop-call-button > .toolbarbutton-badge-container {
toolbarpaletteitem[place="palette"] > #loop-button > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 64px, 64px, 0) !important;
}
#loop-call-button[cui-areatype="menu-panel"][state="disabled"] > .toolbarbutton-badge-container,
#loop-call-button[cui-areatype="menu-panel"][disabled="true"] > .toolbarbutton-badge-container {
#loop-button[cui-areatype="menu-panel"][state="disabled"] > .toolbarbutton-badge-container,
#loop-button[cui-areatype="menu-panel"][disabled="true"] > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 128px, 64px, 64px);
}
#loop-call-button[cui-areatype="menu-panel"]:not([disabled="true"])[state="error"] > .toolbarbutton-badge-container {
#loop-button[cui-areatype="menu-panel"]:not([disabled="true"])[state="error"] > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 192px, 64px, 128px);
}
#loop-call-button[cui-areatype="menu-panel"]:not([disabled="true"])[state="action"] > .toolbarbutton-badge-container {
#loop-button[cui-areatype="menu-panel"]:not([disabled="true"])[state="action"] > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 256px, 64px, 192px);
}
#loop-call-button[cui-areatype="menu-panel"]:not([disabled="true"])[state="action"]:-moz-any(:hover,:hover:active,[open]) > .toolbarbutton-badge-container {
#loop-button[cui-areatype="menu-panel"]:not([disabled="true"])[state="action"]:-moz-any(:hover,:hover:active,[open]) > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 320px, 64px, 256px);
}
#loop-call-button[cui-areatype="menu-panel"]:not([disabled="true"])[state="active"] > .toolbarbutton-badge-container {
#loop-button[cui-areatype="menu-panel"]:not([disabled="true"])[state="active"] > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 384px, 64px, 320px);
}
#loop-call-button[cui-areatype="menu-panel"]:not([disabled="true"])[state="active"]:-moz-any(:hover,:hover:active,[open]) > .toolbarbutton-badge-container {
#loop-button[cui-areatype="menu-panel"]:not([disabled="true"])[state="active"]:-moz-any(:hover,:hover:active,[open]) > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 448px, 64px, 384px);
}
}

View File

@ -175,39 +175,39 @@ toolbaritem[sdkstylewidget="true"] > toolbarbutton {
-moz-image-region: rect(0, 832px, 32px, 800px);
}
#loop-call-button[cui-areatype="menu-panel"] > .toolbarbutton-badge-container,
toolbarpaletteitem[place="palette"] > #loop-call-button > .toolbarbutton-badge-container {
#loop-button[cui-areatype="menu-panel"] > .toolbarbutton-badge-container,
toolbarpaletteitem[place="palette"] > #loop-button > .toolbarbutton-badge-container {
list-style-image: url(chrome://browser/skin/loop/menuPanel.png);
-moz-image-region: rect(0, 32px, 32px, 0);
}
/* Make sure that the state icons are not shown in the customization palette. */
toolbarpaletteitem[place="palette"] > #loop-call-button > .toolbarbutton-badge-container {
toolbarpaletteitem[place="palette"] > #loop-button > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 32px, 32px, 0) !important;
}
#loop-call-button[cui-areatype="menu-panel"][state="disabled"] > .toolbarbutton-badge-container,
#loop-call-button[cui-areatype="menu-panel"][disabled="true"] > .toolbarbutton-badge-container {
#loop-button[cui-areatype="menu-panel"][state="disabled"] > .toolbarbutton-badge-container,
#loop-button[cui-areatype="menu-panel"][disabled="true"] > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 64px, 32px, 32px);
}
#loop-call-button[cui-areatype="menu-panel"]:not([disabled="true"])[state="error"] > .toolbarbutton-badge-container {
#loop-button[cui-areatype="menu-panel"]:not([disabled="true"])[state="error"] > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 96px, 32px, 64px);
}
#loop-call-button[cui-areatype="menu-panel"]:not([disabled="true"])[state="action"] > .toolbarbutton-badge-container {
#loop-button[cui-areatype="menu-panel"]:not([disabled="true"])[state="action"] > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 128px, 32px, 96px);
}
#loop-call-button[cui-areatype="menu-panel"]:not([disabled="true"])[state="action"]:-moz-any(:hover,:hover:active,[open]) > .toolbarbutton-badge-container {
#loop-button[cui-areatype="menu-panel"]:not([disabled="true"])[state="action"]:-moz-any(:hover,:hover:active,[open]) > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 160px, 32px, 128px);
}
#loop-call-button[cui-areatype="menu-panel"]:not([disabled="true"])[state="active"] > .toolbarbutton-badge-container {
#loop-button[cui-areatype="menu-panel"]:not([disabled="true"])[state="active"] > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 192px, 32px, 160px);
}
#loop-call-button[cui-areatype="menu-panel"]:not([disabled="true"])[state="active"]:-moz-any(:hover,:hover:active,[open]) > .toolbarbutton-badge-container {
#loop-button[cui-areatype="menu-panel"]:not([disabled="true"])[state="active"]:-moz-any(:hover,:hover:active,[open]) > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 224px, 32px, 192px);
}

View File

@ -200,37 +200,37 @@ toolbar[brighttext] #sync-button[status="active"]:hover:active:not([disabled="tr
}
%endif
#loop-call-button > .toolbarbutton-badge-container {
#loop-button > .toolbarbutton-badge-container {
list-style-image: url(chrome://browser/skin/loop/toolbar.png);
-moz-image-region: rect(0, 18px, 18px, 0);
}
toolbar[brighttext] #loop-call-button > .toolbarbutton-badge-container {
toolbar[brighttext] #loop-button > .toolbarbutton-badge-container {
list-style-image: url(chrome://browser/skin/loop/toolbar-inverted.png);
}
#loop-call-button[state="disabled"] > .toolbarbutton-badge-container,
#loop-call-button[disabled="true"] > .toolbarbutton-badge-container {
#loop-button[state="disabled"] > .toolbarbutton-badge-container,
#loop-button[disabled="true"] > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 36px, 18px, 18px);
}
#loop-call-button:not([disabled="true"])[state="error"] > .toolbarbutton-badge-container {
#loop-button:not([disabled="true"])[state="error"] > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 54px, 18px, 36px);
}
#loop-call-button:not([disabled="true"])[state="action"] > .toolbarbutton-badge-container {
#loop-button:not([disabled="true"])[state="action"] > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 72px, 18px, 54px);
}
#loop-call-button:not([disabled="true"])[state="action"]:-moz-any(:hover,:hover:active,[open]) > .toolbarbutton-badge-container {
#loop-button:not([disabled="true"])[state="action"]:-moz-any(:hover,:hover:active,[open]) > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 90px, 18px, 72px);
}
#loop-call-button:not([disabled="true"])[state="active"] > .toolbarbutton-badge-container {
#loop-button:not([disabled="true"])[state="active"] > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 108px, 18px, 90px);
}
#loop-call-button:not([disabled="true"])[state="active"]:-moz-any(:hover,:hover:active,[open]) > .toolbarbutton-badge-container {
#loop-button:not([disabled="true"])[state="active"]:-moz-any(:hover,:hover:active,[open]) > .toolbarbutton-badge-container {
-moz-image-region: rect(0, 126px, 18px, 108px);
}

View File

@ -596,7 +596,7 @@ menuitem.bookmark-item {
list-style-image: url("chrome://browser/skin/Toolbar-lunaSilver.png");
}
#loop-call-button > .toolbarbutton-badge-container {
#loop-button > .toolbarbutton-badge-container {
list-style-image: url(chrome://browser/skin/loop/toolbar-lunaSilver.png)
}
}

View File

@ -92,8 +92,10 @@ GENERATED_DIRS += $(dir-tests)
# The test APK needs to know the contents of the target APK while not
# being linked against them. This is a best effort to avoid getting
# out of sync with base's build config.
JARS_DIR := $(DEPTH)/mobile/android/base
JAVA_BOOTCLASSPATH := $(JAVA_BOOTCLASSPATH):$(subst $(NULL) ,:,$(wildcard $(JARS_DIR)/*.jar)):$(ANDROID_COMPAT_LIB)
jars_dir := $(DEPTH)/mobile/android/base
stumbler_jars_dir := $(DEPTH)/mobile/android/stumbler
JAVA_BOOTCLASSPATH := $(JAVA_BOOTCLASSPATH):$(subst $(NULL) ,:,$(wildcard $(jars_dir)/*.jar)):$(subst $(NULL) ,:,$(wildcard $(stumbler_jars_dir)/*.jar)):$(ANDROID_COMPAT_LIB)
# We also want to re-compile classes.dex when the associated base
# content changes.
classes.dex: $(wildcard $(JARS_DIR)/*.jar)
classes.dex: $(wildcard $(jars_dir)/*.jar)
classes.dex: $(wildcard $(stumbler_jars_dir)/*.jar)

Binary file not shown.

Binary file not shown.

View File

@ -229,3 +229,7 @@ https://bad.include-subdomains.pinning-dynamic.example.com:443 privileged,cer
# Host for static pin tests
https://include-subdomains.pinning.example.com:443 privileged,cert=staticPinningBad
# Hosts for sha1 console warning tests
https://sha1ee.example.com:443 privileged,cert=sha1_end_entity
https://sha256ee.example.com:443 privileged,cert=sha256_end_entity

View File

@ -29,6 +29,11 @@ function onUnload() {
// will be apparent by the checks the harness performs.
function test() {
waitForExplicitFinish();
// This test relies on the test timing out in order to indicate failure so
// let's add a dummy pass.
ok(true, "Each test requires at least one pass, fail or todo so here is a pass.");
Services.obs.addObserver(onLoad, "bug839193-loaded", false);
Services.obs.addObserver(onUnload, "bug839193-unloaded", false);

View File

@ -10,6 +10,8 @@ CrossSiteRequestBlocked=Cross-Origin Request Blocked: The Same Origin Policy dis
InvalidSTSHeaders=The site specified an invalid Strict-Transport-Security header.
# LOCALIZATION NOTE: Do not translate "Public-Key-Pins or HPKP"
InvalidPKPHeaders=The site specified an invalid Public-Key-Pins header.
# LOCALIZATION NOTE: Do not translate "SHA-1"
SHA1Sig=This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.
InsecurePasswordsPresentOnPage=Password fields present on an insecure (http://) page. This is a security risk that allows user login credentials to be stolen.
InsecureFormActionPasswordsPresent=Password fields present in a form with an insecure (http://) form action. This is a security risk that allows user login credentials to be stolen.
InsecurePasswordsPresentOnIframe=Password fields present on an insecure (http://) iframe. This is a security risk that allows user login credentials to be stolen.

View File

@ -10,4 +10,4 @@ support-files =
[browser_bug666317.js]
skip-if = e10s # Bug 948194 - Decoded Images seem to not be discarded on memory-pressure notification with e10s enabled
[browser_image.js]
skip-if = e10s
skip-if = e10s || !debug # Test is only to run on debug builds

View File

@ -7,12 +7,15 @@ package org.mozilla.gecko;
import android.content.Context;
import android.content.SharedPreferences;
import org.mozilla.gecko.AppConstants;
import org.mozilla.gecko.preferences.GeckoPreferences;
import org.mozilla.gecko.util.HardwareUtils;
public class NewTabletUI {
// This value should be in sync with preferences_display.xml.
private static final boolean DEFAULT = false;
// This value should be in sync with preferences_display.xml. On non-release
// builds, the preference UI will be hidden and the (unused) default
// preference UI value will still be 'true'.
private static final boolean DEFAULT = !AppConstants.RELEASE_BUILD;
private static Boolean sNewTabletUI;

View File

@ -470,6 +470,7 @@ gbjar.sources += [
'widget/GeckoSwipeRefreshLayout.java',
'widget/GeckoViewFlipper.java',
'widget/IconTabWidget.java',
'widget/ResizablePathDrawable.java',
'widget/SquaredImageView.java',
'widget/SwipeDismissListViewTouchListener.java',
'widget/TabThumbnailWrapper.java',

View File

@ -8,45 +8,27 @@
<item android:state_pressed="true"
android:state_checked="true"
gecko:state_private="true">
<shape>
<solid android:color="@color/highlight_nav_pb" />
</shape>
</item>
gecko:state_private="true"
android:color="@color/highlight_nav_pb" />
<item android:state_checked="true"
gecko:state_private="true">
<shape>
<solid android:color="@color/background_private" />
</shape>
</item>
gecko:state_private="true"
android:color="@color/background_private" />
<item android:state_pressed="true"
gecko:state_private="true">
<shape>
<solid android:color="@color/highlight_dark_focused" />
</shape>
</item>
gecko:state_private="true"
android:color="@color/highlight_dark_focused" />
<item android:state_pressed="true"
android:state_checked="true">
<shape>
<solid android:color="@color/new_tablet_highlight" />
</shape>
</item>
android:state_checked="true"
android:color="@color/new_tablet_highlight" />
<item android:state_checked="true">
<shape>
<solid android:color="@color/background_normal" />
</shape>
</item>
<item android:state_checked="true"
android:color="@color/background_normal" />
<item android:state_pressed="true">
<shape>
<solid android:color="@color/new_tablet_highlight_dark" />
</shape>
</item>
<item android:state_pressed="true"
android:color="@color/new_tablet_highlight_dark" />
<item android:drawable="@android:color/transparent"/>
<item android:color="@android:color/transparent"/>
</selector>

View File

@ -10,8 +10,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:requiresFadingEdge="horizontal"
android:fadingEdgeLength="10dp"
android:paddingTop="8dp"/>
<ImageButton

View File

@ -9,6 +9,5 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/new_tablet_tab_strip_item_width"
android:layout_height="match_parent"
android:background="@drawable/new_tablet_tab_strip_item_bg"
android:paddingLeft="28dp"
android:paddingRight="12dp"/>

View File

@ -27,7 +27,7 @@
<CheckBoxPreference android:key="android.not_a_preference.new_tablet_ui"
android:title="@string/new_tablet_pref"
android:defaultValue="false" />
android:defaultValue="true" />
<PreferenceCategory android:title="@string/pref_category_advanced">

View File

@ -40,12 +40,12 @@ public class TabCurve {
private TabCurve() {
}
public static int getWidthForHeight(int height) {
public static float getWidthForHeight(float height) {
return (int) (height * ASPECT_RATIO);
}
public static void drawFromTop(Path path, int from, int height, Direction dir) {
final int width = getWidthForHeight(height);
public static void drawFromTop(Path path, float from, float height, Direction dir) {
final float width = getWidthForHeight(height);
path.cubicTo(from + width * W_M1 * dir.value, 0.0f,
from + width * W_M2 * dir.value, height * H_M1,
@ -55,8 +55,8 @@ public class TabCurve {
from + width * dir.value, height);
}
public static void drawFromBottom(Path path, int from, int height, Direction dir) {
final int width = getWidthForHeight(height);
public static void drawFromBottom(Path path, float from, float height, Direction dir) {
final float width = getWidthForHeight(height);
path.cubicTo(from + width * (1f - W_M3) * dir.value, height * H_M4,
from + width * (1f - W_M2) * dir.value, height * H_M3,

View File

@ -9,11 +9,15 @@ import org.mozilla.gecko.AboutPages;
import org.mozilla.gecko.R;
import org.mozilla.gecko.Tab;
import org.mozilla.gecko.Tabs;
import org.mozilla.gecko.widget.ResizablePathDrawable;
import org.mozilla.gecko.widget.ResizablePathDrawable.NonScaledPathShape;
import org.mozilla.gecko.widget.ThemedImageButton;
import org.mozilla.gecko.widget.ThemedLinearLayout;
import org.mozilla.gecko.widget.ThemedTextView;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
@ -45,10 +49,10 @@ public class TabStripItemView extends ThemedLinearLayout
private final ThemedTextView titleView;
private final ThemedImageButton closeView;
private final Paint tabPaint;
private final Path tabShape;
private final ResizablePathDrawable backgroundDrawable;
private final Region tabRegion;
private final Region tabClipRegion;
private boolean tabRegionNeedsUpdate;
private final int faviconSize;
private Bitmap lastFavicon;
@ -61,17 +65,17 @@ public class TabStripItemView extends ThemedLinearLayout
super(context, attrs);
setOrientation(HORIZONTAL);
tabShape = new Path();
tabRegion = new Region();
tabClipRegion = new Region();
tabPaint = new Paint();
tabPaint.setAntiAlias(true);
tabPaint.setColor(0xFFFF0000);
tabPaint.setStrokeWidth(0.0f);
tabPaint.setXfermode(new PorterDuffXfermode(Mode.DST_IN));
final Resources res = context.getResources();
faviconSize = getResources().getDimensionPixelSize(R.dimen.new_tablet_tab_strip_favicon_size);
final ColorStateList tabColors =
res.getColorStateList(R.drawable.new_tablet_tab_strip_item_bg);
backgroundDrawable = new ResizablePathDrawable(new TabCurveShape(), tabColors);
setBackgroundDrawable(backgroundDrawable);
faviconSize = res.getDimensionPixelSize(R.dimen.new_tablet_tab_strip_favicon_size);
LayoutInflater.from(context).inflate(R.layout.tab_strip_item_view, this);
setOnClickListener(new View.OnClickListener() {
@ -106,36 +110,10 @@ public class TabStripItemView extends ThemedLinearLayout
protected void onSizeChanged(int width, int height, int oldWidth, int oldHeight) {
super.onSizeChanged(width, height, oldWidth, oldHeight);
tabShape.reset();
final int curveWidth = TabCurve.getWidthForHeight(height);
tabShape.moveTo(0, height);
TabCurve.drawFromBottom(tabShape, 0, height, TabCurve.Direction.RIGHT);
tabShape.lineTo(width - curveWidth, 0);
TabCurve.drawFromTop(tabShape, width - curveWidth, height, TabCurve.Direction.RIGHT);
tabShape.lineTo(0, height);
tabClipRegion.set(0, 0, width, height);
tabRegion.setPath(tabShape, tabClipRegion);
}
@Override
public void draw(Canvas canvas) {
final int saveCount = canvas.saveLayer(0, 0,
getWidth(), getHeight(), null,
Canvas.MATRIX_SAVE_FLAG |
Canvas.CLIP_SAVE_FLAG |
Canvas.HAS_ALPHA_LAYER_SAVE_FLAG |
Canvas.FULL_COLOR_LAYER_SAVE_FLAG |
Canvas.CLIP_TO_LAYER_SAVE_FLAG);
super.draw(canvas);
canvas.drawPath(tabShape, tabPaint);
canvas.restoreToCount(saveCount);
// Queue a tab region update in the next draw() call. We don't
// update it immediately here because we need the new path from
// the background drawable to be updated first.
tabRegionNeedsUpdate = true;
}
@Override
@ -152,6 +130,18 @@ public class TabStripItemView extends ThemedLinearLayout
return super.onTouchEvent(event);
}
@Override
public void draw(Canvas canvas) {
super.draw(canvas);
if (tabRegionNeedsUpdate) {
final Path path = backgroundDrawable.getPath();
tabClipRegion.set(0, 0, getWidth(), getHeight());
tabRegion.setPath(path, tabClipRegion);
tabRegionNeedsUpdate = false;
}
}
@Override
public int[] onCreateDrawableState(int extraSpace) {
final int[] drawableState = super.onCreateDrawableState(extraSpace + 1);
@ -237,4 +227,22 @@ public class TabStripItemView extends ThemedLinearLayout
Bitmap.createScaledBitmap(favicon, faviconSize, faviconSize, false);
faviconView.setImageBitmap(scaledFavicon);
}
private static class TabCurveShape extends NonScaledPathShape {
@Override
protected void onResize(float width, float height) {
final Path path = getPath();
path.reset();
final float curveWidth = TabCurve.getWidthForHeight(height);
path.moveTo(0, height);
TabCurve.drawFromBottom(path, 0, height, TabCurve.Direction.RIGHT);
path.lineTo(width - curveWidth, 0);
TabCurve.drawFromTop(path, width - curveWidth, height, TabCurve.Direction.RIGHT);
path.lineTo(0, height);
}
}
}

View File

@ -187,7 +187,7 @@ public class StringHelper {
public static final String ABOUT_LABEL = "About " + BRAND_NAME;
public static final String FAQS_LABEL = "FAQs";
public static final String FEEDBACK_LABEL = "Give feedback";
public static final String LOCATION_SERVICES_LABEL = "Mozilla location services";
public static final String LOCATION_SERVICES_LABEL = "Mozilla Location Service";
public static final String HEALTH_REPORT_LABEL = BRAND_NAME + " Health Report";
public static final String MY_HEALTH_REPORT_LABEL = "View my Health Report";

View File

@ -144,3 +144,5 @@ skip-if = android_version == "10"
# testSelectionHandler disabled on Android 2.3 by trailing skip-if, due to bug 980074
[testSelectionHandler]
skip-if = android_version == "10"
[testStumblerSetting]

View File

@ -0,0 +1,90 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* * License, v. 2.0. If a copy of the MPL was not distributed with this
* * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.tests;
import org.mozilla.gecko.AppConstants;
import org.mozilla.gecko.preferences.GeckoPreferences;
import org.mozilla.mozstumbler.service.AppGlobals;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import com.jayway.android.robotium.solo.Condition;
/*
* This test enables (checkbox checked) the Fennec setting to contribute to MLS, then waits for
* a response Intent from the stumbler service to confirm it has started. Then, it disables the
* service in the setting, and waits for confirmation that the servie has stopped.
*/
public class testStumblerSetting extends BaseTest {
boolean mIsEnabled;
public void testStumblerSetting() {
if (!AppConstants.MOZ_STUMBLER_BUILD_TIME_ENABLED) {
mAsserter.info("Checking stumbler build config.", "Skipping test as Stumbler is not enabled in this build.");
return;
}
blockForGeckoReady();
selectMenuItem(StringHelper.SETTINGS_LABEL);
mAsserter.ok(mSolo.waitForText(StringHelper.SETTINGS_LABEL),
"The Settings menu did not load", StringHelper.SETTINGS_LABEL);
String section = "^" + StringHelper.MOZILLA_SECTION_LABEL + "$";
waitForEnabledText(section);
mSolo.clickOnText(section);
String itemTitle = "^" + StringHelper.LOCATION_SERVICES_LABEL + "$";
boolean foundText = waitForPreferencesText(itemTitle);
mAsserter.ok(foundText, "Waiting for settings item " + itemTitle + " in section " + section,
"The " + itemTitle + " option is present in section " + section);
BroadcastReceiver enabledDisabledReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(AppGlobals.ACTION_TEST_SETTING_ENABLED)) {
mIsEnabled = true;
} else {
mIsEnabled = false;
}
}
};
Context context = getInstrumentation().getTargetContext();
IntentFilter intentFilter = new IntentFilter(AppGlobals.ACTION_TEST_SETTING_ENABLED);
intentFilter.addAction(AppGlobals.ACTION_TEST_SETTING_DISABLED);
context.registerReceiver(enabledDisabledReceiver, intentFilter);
boolean checked = mSolo.isCheckBoxChecked(itemTitle);
try {
mAsserter.ok(!checked, "Checking stumbler setting is unchecked.", "Unchecked as expected.");
waitForEnabledText(itemTitle);
mSolo.clickOnText(itemTitle);
mSolo.waitForCondition(new Condition() {
@Override
public boolean isSatisfied() {
return mIsEnabled;
}
}, 15000);
mAsserter.ok(mIsEnabled, "Checking if stumbler became enabled.", "Stumbler is enabled.");
mSolo.clickOnText(itemTitle);
mSolo.waitForCondition(new Condition() {
@Override
public boolean isSatisfied() {
return !mIsEnabled;
}
}, 15000);
mAsserter.ok(!mIsEnabled, "Checking if stumbler became disabled.", "Stumbler is disabled.");
} finally {
context.unregisterReceiver(enabledDisabledReceiver);
}
}
}

View File

@ -0,0 +1,96 @@
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.widget;
import android.content.res.ColorStateList;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.Shape;
public class ResizablePathDrawable extends ShapeDrawable {
private final ColorStateList colorStateList;
private int currentColor;
public ResizablePathDrawable(NonScaledPathShape shape, int color) {
this(shape, ColorStateList.valueOf(color));
}
public ResizablePathDrawable(NonScaledPathShape shape, ColorStateList colorStateList) {
super(shape);
this.colorStateList = colorStateList;
updateColor(getState());
}
private boolean updateColor(int[] stateSet) {
int newColor = colorStateList.getColorForState(stateSet, Color.WHITE);
if (newColor != currentColor) {
currentColor = newColor;
invalidateSelf();
return true;
}
return false;
}
public Path getPath() {
final NonScaledPathShape shape = (NonScaledPathShape) getShape();
return shape.path;
}
@Override
public boolean isStateful() {
return true;
}
@Override
protected void onDraw(Shape shape, Canvas canvas, Paint paint) {
paint.setColor(currentColor);
super.onDraw(shape, canvas, paint);
}
@Override
protected boolean onStateChange(int[] stateSet) {
return updateColor(stateSet);
}
/**
* Path-based shape implementation that re-creates the path
* when it gets resized as opposed to PathShape's scaling
* behaviour.
*/
public static class NonScaledPathShape extends Shape {
private Path path;
public NonScaledPathShape() {
path = new Path();
}
@Override
public void draw(Canvas canvas, Paint paint) {
// No point in drawing the shape if it's not
// going to be visible.
if (paint.getColor() == Color.TRANSPARENT) {
return;
}
canvas.drawPath(path, paint);
}
protected Path getPath() {
return path;
}
@Override
public NonScaledPathShape clone() throws CloneNotSupportedException {
final NonScaledPathShape clonedShape = (NonScaledPathShape) super.clone();
clonedShape.path = new Path(path);
return clonedShape;
}
}
}

View File

@ -56,5 +56,8 @@ public class AppGlobals {
guiLogMessageBuffer.add("<font color='" + color +"'>" + msg + "</font>");
}
}
public static final String ACTION_TEST_SETTING_ENABLED = "stumbler-test-setting-enabled";
public static final String ACTION_TEST_SETTING_DISABLED = "stumbler-test-setting-disabled";
}

View File

@ -55,11 +55,15 @@ public class PassiveServiceReceiver extends BroadcastReceiver {
if (!StumblerService.sFirefoxStumblingEnabled.get()) {
// This calls the service's onDestroy(), and the service's onHandleIntent(...) is not called
context.stopService(new Intent(context, StumblerService.class));
// For testing service messages were received
context.sendBroadcast(new Intent(AppGlobals.ACTION_TEST_SETTING_DISABLED));
return;
}
Log.d(LOG_TAG, "Stumbler: Sending passive start message | isDebug:" + AppGlobals.isDebug);
// For testing service messages were received
context.sendBroadcast(new Intent(AppGlobals.ACTION_TEST_SETTING_ENABLED));
Log.d(LOG_TAG, "Stumbler: Sending passive start message | isDebug:" + AppGlobals.isDebug);
final Intent startServiceIntent = new Intent(context, StumblerService.class);
startServiceIntent.putExtra(StumblerService.ACTION_START_PASSIVE, true);

View File

@ -69,6 +69,8 @@
#include "AlternateServices.h"
#include "InterceptedChannel.h"
#include "nsIHttpPushListener.h"
#include "nsIX509Cert.h"
#include "ScopedNSSTypes.h"
namespace mozilla { namespace net {
@ -1214,6 +1216,29 @@ nsHttpChannel::ProcessSSLInformation()
if (!sslstat)
return;
// Send (SHA-1) signature algorithm errors to the web console
nsCOMPtr<nsIX509Cert> cert;
sslstat->GetServerCert(getter_AddRefs(cert));
if (cert) {
ScopedCERTCertificate nssCert(cert->GetCert());
if (nssCert) {
SECOidTag tag = SECOID_GetAlgorithmTag(&nssCert->signature);
LOG(("Checking certificate signature: The OID tag is %i [this=%p]\n", tag, this));
// Check to see if the signature is sha-1 based.
// Not including checks for SEC_OID_ISO_SHA1_WITH_RSA_SIGNATURE
// from http://tools.ietf.org/html/rfc2437#section-8 since I
// can't see reference to it outside this spec
if (tag == SEC_OID_PKCS1_SHA1_WITH_RSA_ENCRYPTION ||
tag == SEC_OID_ANSIX9_DSA_SIGNATURE_WITH_SHA1_DIGEST ||
tag == SEC_OID_ANSIX962_ECDSA_SHA1_SIGNATURE) {
nsString consoleErrorTag = NS_LITERAL_STRING("SHA1Sig");
nsString consoleErrorMessage
= NS_LITERAL_STRING("SHA-1 Signature");
AddSecurityMessage(consoleErrorTag, consoleErrorMessage);
}
}
}
// If certificate exceptions are being used don't record this information
// in the permission manager.
bool trustCheck;

View File

@ -21,6 +21,11 @@ function onUnload() {
// there are no actual checks here.
function test() {
waitForExplicitFinish();
// This test relies on the test timing out in order to indicate failure so
// let's add a dummy pass.
ok(true, "Each test requires at least one pass, fail or todo so here is a pass.");
gBugWindow = window.openDialog("chrome://pippki/content/certManager.xul");
gBugWindow.addEventListener("load", onLoad);
}

View File

@ -354,7 +354,13 @@ Tester.prototype = {
catch (ex) {
this.currentTest.addResult(new testResult(false, "Cleanup function threw an exception", ex, false));
}
};
}
if (this.currentTest.passCount === 0 &&
this.currentTest.failCount === 0 &&
this.currentTest.todoCount === 0) {
this.currentTest.addResult(new testResult(false, "This test contains no passes, no fails and no todos. Maybe it threw a silent exception? Make sure you use waitForExplicitFinish() if you need it.", "", false));
}
if (testScope.__expected == 'fail' && testScope.__num_failed <= 0) {
this.currentTest.addResult(new testResult(false, "We expected at least one assertion to fail because this test file was marked as fail-if in the manifest", "", false));

View File

@ -25,6 +25,7 @@ skip-if = e10s # Bug ?????? - EventUtils.synthesizeKey not e10s friendly
[browser_bug591465.js]
[browser_bug591663.js]
[browser_bug593535.js]
skip-if = true # Bug 1093190 - Disabled due to leak
[browser_bug596336.js]
[browser_bug608316.js]
[browser_bug610764.js]

View File

@ -12,7 +12,6 @@ const QUERY = "NOTFOUND";
var gProvider;
function test() {
return;
waitForExplicitFinish();
// Turn on searching for this test