Merge m-c to b2g-inbound. a=merge

This commit is contained in:
Ryan VanderMeulen 2014-11-07 14:04:37 -05:00
commit 96c9f5a0b6
122 changed files with 990 additions and 618 deletions

View File

@ -1244,6 +1244,9 @@ pref("services.sync.prefs.sync.addons.ignoreUserEnabledChanges", true);
pref("services.sync.prefs.sync.app.update.mode", true);
pref("services.sync.prefs.sync.browser.formfill.enable", true);
pref("services.sync.prefs.sync.browser.link.open_newwindow", true);
pref("services.sync.prefs.sync.browser.newtabpage.enabled", true);
pref("services.sync.prefs.sync.browser.newtabpage.enhanced", true);
pref("services.sync.prefs.sync.browser.newtabpage.pinned", true);
pref("services.sync.prefs.sync.browser.offline-apps.notify", true);
pref("services.sync.prefs.sync.browser.safebrowsing.enabled", true);
pref("services.sync.prefs.sync.browser.safebrowsing.malware.enabled", true);
@ -1633,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

@ -392,13 +392,13 @@ skip-if = e10s
[browser_dbg_searchbox-parse.js]
skip-if = e10s
[browser_dbg_source-maps-01.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_source-maps-02.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_source-maps-03.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_source-maps-04.js]
skip-if = e10s
skip-if = e10s # Bug 1093535
[browser_dbg_sources-cache.js]
skip-if = e10s
[browser_dbg_sources-labels.js]

View File

@ -9,13 +9,12 @@
const TAB_URL = EXAMPLE_URL + "doc_binary_search.html";
const COFFEE_URL = EXAMPLE_URL + "code_binary_search.coffee";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gEditor, gSources;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gEditor = gDebugger.DebuggerView.editor;
@ -119,7 +118,7 @@ function testHitBreakpoint() {
// This will cause the breakpoint to be hit, and put us back in the
// paused state.
gDebuggee.binary_search([0, 2, 3, 5, 7, 10], 5);
callInTab(gTab, "binary_search", [0, 2, 3, 5, 7, 10], 5);
});
return deferred.promise;
@ -157,7 +156,6 @@ function testStepping() {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gEditor = null;

View File

@ -8,12 +8,12 @@
const TAB_URL = EXAMPLE_URL + "doc_binary_search.html";
const JS_URL = EXAMPLE_URL + "code_binary_search.js";
let gDebuggee, gPanel, gDebugger, gEditor;
let gTab, gPanel, gDebugger, gEditor;
let gSources, gFrames, gPrefs, gOptions;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
gDebuggee = aDebuggee;
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gEditor = gDebugger.DebuggerView.editor;
@ -81,7 +81,7 @@ function testSetBreakpoint() {
// This will cause the breakpoint to be hit, and put us back in the
// paused state.
gDebuggee.binary_search([0, 2, 3, 5, 7, 10], 5);
callInTab(gTab, "binary_search", [0, 2, 3, 5, 7, 10], 5);
});
});
@ -135,7 +135,7 @@ function testResume() {
}
registerCleanupFunction(function() {
gDebuggee = null;
gTab = null;
gPanel = null;
gDebugger = null;
gEditor = null;

View File

@ -8,12 +8,12 @@
const TAB_URL = EXAMPLE_URL + "doc_minified.html";
const JS_URL = EXAMPLE_URL + "code_math.js";
let gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gEditor, gSources, gFrames;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
gDebuggee = aDebuggee;
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gEditor = gDebugger.DebuggerView.editor;
@ -64,7 +64,7 @@ function testSetBreakpoint() {
// This will cause the breakpoint to be hit, and put us back in the
// paused state.
gDebuggee.arithmetic();
callInTab(gTab, "arithmetic");
});
});
@ -72,7 +72,7 @@ function testSetBreakpoint() {
}
registerCleanupFunction(function() {
gDebuggee = null;
gTab = null;
gPanel = null;
gDebugger = null;
gEditor = null;

View File

@ -16,7 +16,7 @@ DevToolsUtils.reportingDisabled = true;
let gPanel, gDebugger, gFrames, gSources, gPrefs, gOptions;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gFrames = gDebugger.DebuggerView.StackFrames;

View File

@ -10,9 +10,10 @@ loadSubScript("chrome://marionette/content/EventUtils.js", EventUtils);
dump("Frame script loaded.\n");
addMessageListener("test:call", function (message) {
dump("Calling function with name " + message.data + ".\n");
dump("Calling function with name " + message.data.name + ".\n");
XPCNativeWrapper.unwrap(content)[message.data]();
let data = message.data;
XPCNativeWrapper.unwrap(content)[data.name].apply(undefined, data.args);
sendAsyncMessage("test:call");
});

View File

@ -963,7 +963,10 @@ function waitForMessageFromTab(tab, name) {
function callInTab(tab, name) {
info("Calling function with name " + name + " in tab.");
sendMessageToTab(tab, "test:call", name);
sendMessageToTab(tab, "test:call", {
name: name,
args: Array.prototype.slice.call(arguments, 2)
});
waitForMessageFromTab(tab, "test:call");
}

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

@ -2296,6 +2296,12 @@ WebSocketImpl::CancelInternal()
{
AssertIsOnTargetThread();
// If CancelInternal is called by a runnable, we may already be disconnected
// by the time it runs.
if (mDisconnected) {
return NS_OK;
}
int64_t readyState = mWebSocket->ReadyState();
if (readyState == WebSocket::CLOSING || readyState == WebSocket::CLOSED) {
return NS_OK;

View File

@ -185,8 +185,9 @@ nsCSPContext::ShouldLoad(nsContentPolicyType aContentType,
// decision may be wrong due to the inability to get the nonce, and will
// incorrectly fail the unit tests.
if (!isPreload) {
nsCOMPtr<nsIURI> originalURI = do_QueryInterface(aExtra);
this->AsyncReportViolation(aContentLocation,
mSelfURI,
originalURI, /* in case of redirect originalURI is not null */
violatedDirective,
p, /* policy index */
EmptyString(), /* no observer subject */
@ -418,7 +419,7 @@ nsCSPContext::GetAllowsHash(const nsAString& aContent,
mPolicies[p]->getDirectiveStringForContentType( \
nsIContentPolicy::TYPE_ ## contentPolicyType, \
violatedDirective); \
this->AsyncReportViolation(selfISupports, mSelfURI, violatedDirective, p, \
this->AsyncReportViolation(selfISupports, nullptr, violatedDirective, p, \
NS_LITERAL_STRING(observerTopic), \
aSourceFile, aScriptSample, aLineNum); \
} \
@ -540,6 +541,23 @@ nsCSPContext::SetRequestContext(nsIURI* aSelfURI,
return NS_OK;
}
/**
* Sends CSP violation reports to all sources listed under report-uri.
*
* @param aBlockedContentSource
* Either a CSP Source (like 'self', as string) or nsIURI: the source
* of the violation.
* @param aOriginalUri
* The original URI if the blocked content is a redirect, else null
* @param aViolatedDirective
* the directive that was violated (string).
* @param aSourceFile
* name of the file containing the inline script violation
* @param aScriptSample
* a sample of the violating inline script
* @param aLineNum
* source line number of the violation (if available)
*/
nsresult
nsCSPContext::SendReports(nsISupports* aBlockedContentSource,
nsIURI* aOriginalURI,
@ -569,7 +587,15 @@ nsCSPContext::SendReports(nsISupports* aBlockedContentSource,
nsCOMPtr<nsIURI> uri = do_QueryInterface(aBlockedContentSource);
// could be a string or URI
if (uri) {
uri->GetSpecIgnoringRef(reportBlockedURI);
// aOriginalURI will only be *not* null in case of a redirect in which
// case aOriginalURI is the uri before the redirect.
if (aOriginalURI) {
// do not report anything else than the origin in case of a redirect, see:
// http://www.w3.org/TR/CSP/#violation-reports
uri->GetPrePath(reportBlockedURI);
} else {
uri->GetSpecIgnoringRef(reportBlockedURI);
}
} else {
nsCOMPtr<nsISupportsCString> cstr = do_QueryInterface(aBlockedContentSource);
if (cstr) {
@ -585,11 +611,9 @@ nsCSPContext::SendReports(nsISupports* aBlockedContentSource,
}
// document-uri
if (aOriginalURI) {
nsAutoCString reportDocumentURI;
aOriginalURI->GetSpecIgnoringRef(reportDocumentURI);
report.mCsp_report.mDocument_uri = NS_ConvertUTF8toUTF16(reportDocumentURI);
}
nsAutoCString reportDocumentURI;
mSelfURI->GetSpecIgnoringRef(reportDocumentURI);
report.mCsp_report.mDocument_uri = NS_ConvertUTF8toUTF16(reportDocumentURI);
// original-policy
nsAutoString originalPolicy;
@ -731,7 +755,7 @@ nsCSPContext::SendReports(nsISupports* aBlockedContentSource,
rv = cp->ShouldLoad(nsIContentPolicy::TYPE_CSP_REPORT,
reportURI,
aOriginalURI,
mSelfURI,
nullptr, // Context
EmptyCString(), // mime type
nullptr, // Extra parameter
@ -1047,7 +1071,7 @@ nsCSPContext::PermitsAncestry(nsIDocShell* aDocShell, bool* outPermitsAncestry)
bool okToSendAncestor = NS_SecurityCompareURIs(ancestorsArray[a], mSelfURI, true);
this->AsyncReportViolation((okToSendAncestor ? ancestorsArray[a] : nullptr),
mSelfURI,
nullptr, /* originalURI in case of redirect */
violatedDirective,
i, /* policy index */
EmptyString(), /* no observer subject */
@ -1080,7 +1104,7 @@ nsCSPContext::PermitsBaseURI(nsIURI* aURI, bool* outPermitsBaseURI)
nsAutoString violatedDirective;
mPolicies[i]->getDirectiveStringForBaseURI(violatedDirective);
this->AsyncReportViolation(aURI,
mSelfURI,
nullptr, /* originalURI in case of redirect */
violatedDirective,
i, /* policy index */
EmptyString(), /* no observer subject */

View File

@ -275,8 +275,13 @@ NS_IMETHODIMP
nsDOMWindowUtils::UpdateLayerTree()
{
if (nsIPresShell* presShell = GetPresShell()) {
presShell->FlushPendingNotifications(Flush_Display);
nsRefPtr<nsViewManager> vm = presShell->GetViewManager();
vm->ProcessPendingUpdates();
nsView* view = vm->GetRootView();
if (view) {
presShell->Paint(view, view->GetBounds(),
nsIPresShell::PAINT_LAYERS | nsIPresShell::PAINT_SYNC_DECODE_IMAGES);
}
}
return NS_OK;
}

View File

@ -194,7 +194,6 @@
#include "mozilla/dom/SelectionChangeEvent.h"
#include "mozilla/AddonPathService.h"
#include "mozilla/Services.h"
#include "mozilla/Telemetry.h"
#include "nsLocation.h"
@ -2266,12 +2265,6 @@ CreateNativeGlobalForInner(JSContext* aCx,
top = aNewInner->GetTop();
}
JS::CompartmentOptions options;
// Sometimes add-ons load their own XUL windows, either as separate top-level
// windows or inside a browser element. In such cases we want to tag the
// window's compartment with the add-on ID. See bug 1092156.
options.setAddonId(MapURIToAddonID(aURI));
if (top) {
if (top->GetGlobalJSObject()) {
options.setSameZoneAs(top->GetGlobalJSObject());

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

@ -940,11 +940,11 @@ NS_IMPL_ISUPPORTS(SpeechRecognition::GetUserMediaSuccessCallback, nsIDOMGetUserM
NS_IMETHODIMP
SpeechRecognition::GetUserMediaSuccessCallback::OnSuccess(nsISupports* aStream)
{
DOMLocalMediaStream *localStream = nullptr;
nsresult rv = CallQueryInterface(aStream, &localStream);
if (NS_SUCCEEDED(rv)) {
mRecognition->StartRecording(localStream);
nsRefPtr<DOMMediaStream> stream = do_QueryObject(aStream);
if (!stream) {
return NS_ERROR_NO_INTERFACE;
}
mRecognition->StartRecording(stream);
return NS_OK;
}

View File

@ -43,6 +43,44 @@ using namespace mozilla::gfx;
#include "DeprecatedPremultiplyTables.h"
extern "C" {
/**
* Dump a raw image to the default log. This function is exported
* from libxul, so it can be called from any library in addition to
* (of course) from a debugger.
*
* Note: this helper currently assumes that all 2-bytepp images are
* r5g6b5, and that all 4-bytepp images are r8g8b8a8.
*/
NS_EXPORT
void mozilla_dump_image(void* bytes, int width, int height, int bytepp,
int strideBytes)
{
if (0 == strideBytes) {
strideBytes = width * bytepp;
}
SurfaceFormat format;
// TODO more flexible; parse string?
switch (bytepp) {
case 2:
format = SurfaceFormat::R5G6B5;
break;
case 4:
default:
format = SurfaceFormat::R8G8B8A8;
break;
}
RefPtr<DataSourceSurface> surf =
Factory::CreateWrappingDataSourceSurface((uint8_t*)bytes, strideBytes,
gfx::IntSize(width, height),
format);
gfxUtils::DumpAsDataURI(surf);
}
}
static const uint8_t PremultiplyValue(uint8_t a, uint8_t v) {
return gfxUtils::sPremultiplyTable[a*256+v];
}

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

@ -1223,7 +1223,9 @@ static const JSStdName builtin_property_names[] = {
{ EAGER_ATOM(SIMD), JSProto_SIMD },
{ EAGER_ATOM(TypedObject), JSProto_TypedObject },
#endif
#ifdef ENABLE_SHARED_ARRAY_BUFFER
{ EAGER_ATOM(Atomics), JSProto_Atomics },
#endif
{ 0, JSProto_LIMIT }
};

View File

@ -346,16 +346,6 @@ XPCWrappedNativeScope::EnsureAddonScope(JSContext *cx, JSAddonId *addonId)
MOZ_ASSERT(addonId);
MOZ_ASSERT(nsContentUtils::IsSystemPrincipal(GetPrincipal()));
// In bug 1092156, we found that add-on scopes don't work correctly when the
// window navigates. The add-on global's prototype is an outer window, so,
// after the navigation, looking up window properties in the add-on scope
// will fail. However, in most cases where the window can be navigated, the
// entire window is part of the add-on. To solve the problem, we avoid
// returning an add-on scope for a window that is already tagged with the
// add-on ID.
if (AddonIdOfObject(global) == addonId)
return global;
// If we already have an addon scope object, we know what to use.
for (size_t i = 0; i < mAddonScopes.Length(); i++) {
if (JS::AddonIdOfObject(js::UncheckedUnwrap(mAddonScopes[i])) == addonId)

View File

@ -1424,6 +1424,8 @@ public:
PAINT_LAYERS = 0x01,
/* Composite layers to the window. */
PAINT_COMPOSITE = 0x02,
/* Sync-decode images. */
PAINT_SYNC_DECODE_IMAGES = 0x04
};
virtual void Paint(nsView* aViewToPaint, const nsRegion& aDirtyRegion,
uint32_t aFlags) = 0;

View File

@ -6270,7 +6270,8 @@ PresShell::Paint(nsView* aViewToPaint,
NS_WARNING("Must complete empty transaction when compositing!");
}
if (!(frame->GetStateBits() & NS_FRAME_UPDATE_LAYER_TREE) &&
if (!(aFlags & PAINT_SYNC_DECODE_IMAGES) &&
!(frame->GetStateBits() & NS_FRAME_UPDATE_LAYER_TREE) &&
!mNextPaintCompressed) {
NotifySubDocInvalidationFunc computeInvalidFunc =
presContext->MayHavePaintEventListenerInSubDocument() ? nsPresContext::NotifySubDocInvalidation : 0;
@ -6323,6 +6324,9 @@ PresShell::Paint(nsView* aViewToPaint,
if (!(aFlags & PAINT_COMPOSITE)) {
flags |= nsLayoutUtils::PAINT_NO_COMPOSITE;
}
if (aFlags & PAINT_SYNC_DECODE_IMAGES) {
flags |= nsLayoutUtils::PAINT_SYNC_DECODE_IMAGES;
}
if (mNextPaintCompressed) {
flags |= nsLayoutUtils::PAINT_COMPRESSED;
mNextPaintCompressed = false;

View File

@ -0,0 +1,84 @@
<!DOCTYPE HTML>
<html id="html" style="height:100%">
<head>
<title>Testing effect of listener on body</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<style>
.target { position:absolute; left:200px; top:200px; width:200px; height:200px; background:blue; }
</style>
</head>
<body id="body" onload="setTimeout(runTest, 0)" style="margin:0; width:100%; height:100%; overflow:hidden">
<div id="content">
<div id="ruler" style="position:absolute; left:0; top:0; width:1mozmm; height:0;"></div>
<div class="target" id="t"></div>
</div>
<pre id="test">
<script type="application/javascript">
var eventTarget;
window.onmousedown = function(event) { eventTarget = event.target; };
// Make sure the target div is "clickable" by adding a click listener on it.
document.getElementById('t').addEventListener('click', function(e) {
parent.ok(true, "target was clicked on");
}, false);
// Helper functions
function testMouseClick(aX, aY, aExpectedId, aMsg) {
eventTarget = null;
synthesizeMouseAtPoint(aX, aY, {});
try {
parent.is(eventTarget.id, aExpectedId,
"checking offset " + aX + "," + aY + " hit " + aExpectedId + " [" + aMsg + "]");
} catch (ex) {
parent.ok(false, "checking offset " + aX + "," + aY + " hit " + aExpectedId + " [" + aMsg + "]; got " + eventTarget);
}
}
function testWithAndWithoutBodyListener(aX, aY, aExpectedId, aMsg) {
var func = function(e) {
// no-op function
parent.ok(true, "body was clicked on");
};
testMouseClick(aX, aY, aExpectedId, aMsg + " without listener on body");
document.body.addEventListener("click", func, false);
testMouseClick(aX, aY, aExpectedId, aMsg + " with listener on body");
document.body.removeEventListener("click", func, false);
}
// Main tests
var mm;
function runTest() {
mm = document.getElementById("ruler").getBoundingClientRect().width;
parent.ok(4*mm >= 10, "WARNING: mm " + mm + " too small in this configuration. Test results will be bogus");
// Test near the target, check it hits the target
testWithAndWithoutBodyListener(200 - 2*mm, 200 - 2*mm, "t", "basic click retargeting");
// Test on the target, check it hits the target
testWithAndWithoutBodyListener(200 + 2*mm, 200 + 2*mm, "t", "direct click");
// Test outside the target, check it hits the root
testWithAndWithoutBodyListener(40, 40, "body", "click way outside target");
SpecialPowers.pushPrefEnv({"set": [["ui.mouse.radius.enabled", false]]}, runTest2);
}
function runTest2() {
// In this test, mouse event retargeting is disabled.
// Test near the target, check it hits the body
testWithAndWithoutBodyListener(200 - 2*mm, 200 - 2*mm, "body", "basic click retargeting");
// Test on the target, check it hits the target
testWithAndWithoutBodyListener(200 + 2*mm, 200 + 2*mm, "t", "direct click");
// Test outside the target, check it hits the root
testWithAndWithoutBodyListener(40, 40, "body", "click way outside target");
parent.finishTest();
}
</script>
</pre>
</body>
</html>

View File

@ -506,3 +506,5 @@ support-files = bug1078327_inner.html
[test_bug1080361.html]
support-files = bug1080361_inner.html
[test_touchcaret_visibility.html]
[test_bug1093686.html]
support-files = bug1093686_inner.html

View File

@ -0,0 +1,41 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1093686
-->
<head>
<meta charset="utf-8">
<title>Testing effect of listener on body with respect to event retargeting</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="text/javascript">
var iframe = undefined;
function prepareTest() {
SimpleTest.waitForExplicitFinish();
iframe = document.getElementById("testFrame");
turnOnEventRetargeting(startTest);
}
function turnOnEventRetargeting(callback) {
SpecialPowers.pushPrefEnv({
"set": [
["ui.mouse.radius.enabled", true],
["ui.mouse.radius.inputSource.touchOnly", false],
["ui.mouse.radius.leftmm", 8],
["ui.mouse.radius.topmm", 12],
["ui.mouse.radius.rightmm", 8],
["ui.mouse.radius.bottommm", 4]
]
}, callback);
}
function startTest() {
iframe.src = "bug1093686_inner.html";
}
function finishTest() {
SimpleTest.finish();
}
</script>
</head>
<body onload="prepareTest()">
<iframe id="testFrame" height="700" width="700"></iframe>
</body>
</html>

View File

@ -10,7 +10,7 @@
#include "mozilla/Types.h"
/* Override some jemalloc defaults */
MFBT_DATA const char * je_(malloc_conf) = "narenas:1,lg_chunk:20";
MFBT_DATA const char * je_(malloc_conf) = "narenas:1,lg_chunk:20,tcache:false";
#ifdef ANDROID
#include <android/log.h>

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',

Some files were not shown because too many files have changed in this diff Show More