Backed out 9 changesets (bug 1472212) for browser chrome failures on browser_report_site_issue. CLOSED TREE

Backed out changeset 78a9a2adf32a (bug 1472212)
Backed out changeset 9ff5280fc25a (bug 1472212)
Backed out changeset c3c22abaf108 (bug 1472212)
Backed out changeset a28443371b94 (bug 1472212)
Backed out changeset 55c2a8d227dc (bug 1472212)
Backed out changeset a8bba29ad2cb (bug 1472212)
Backed out changeset e1cafd30a69a (bug 1472212)
Backed out changeset cecc2d52e72e (bug 1472212)
Backed out changeset 101903689bc0 (bug 1472212)
This commit is contained in:
Cosmin Sabou 2018-10-12 20:45:48 +03:00
Родитель 7832ecfb51
Коммит 86aba0737b
20 изменённых файлов: 104 добавлений и 241 удалений

Просмотреть файл

@ -475,11 +475,6 @@ pref("browser.tabs.showAudioPlayingIcon", true);
// This should match Chromium's audio indicator delay.
pref("browser.tabs.delayHidingAudioPlayingIconMS", 3000);
// Pref to control whether we use separate privileged content processes.
#ifdef NIGHTLY_BUILD
pref("browser.tabs.remote.separatePrivilegedContentProcess", true);
#endif
pref("browser.ctrlTab.recentlyUsedOrder", true);
// By default, do not export HTML at shutdown.

Просмотреть файл

@ -718,7 +718,7 @@ window._gBrowser = {
/**
* Determine if a URI is an about: page pointing to a local resource.
*/
isLocalAboutURI(aURI, aResolvedURI) {
_isLocalAboutURI(aURI, aResolvedURI) {
if (!aURI.schemeIs("about")) {
return false;
}
@ -745,15 +745,6 @@ window._gBrowser = {
}
},
/**
* Sets an icon for the tab if the URI is defined in FAVICON_DEFAULTS.
*/
setDefaultIcon(aTab, aURI) {
if (aURI && aURI.spec in FAVICON_DEFAULTS) {
this.setIcon(aTab, FAVICON_DEFAULTS[aURI.spec]);
}
},
setIcon(aTab, aIconURL = "", aOriginalURL = aIconURL, aLoadingPrincipal = null) {
let makeString = (url) => url instanceof Ci.nsIURI ? url.spec : url;
@ -2489,7 +2480,9 @@ window._gBrowser = {
// Hack to ensure that the about:newtab, and about:welcome favicon is loaded
// instantaneously, to avoid flickering and improve perceived performance.
this.setDefaultIcon(t, aURIObject);
if (aURI in FAVICON_DEFAULTS) {
this.setIcon(t, FAVICON_DEFAULTS[aURI]);
}
// Dispatch a new tab notification. We do this once we're
// entirely done, so that things are in a consistent state
@ -4747,7 +4740,7 @@ class TabProgressListener {
// Don't show progress indicators in tabs for about: URIs
// pointing to local resources.
if ((aRequest instanceof Ci.nsIChannel) &&
gBrowser.isLocalAboutURI(aRequest.originalURI, aRequest.URI)) {
gBrowser._isLocalAboutURI(aRequest.originalURI, aRequest.URI)) {
return false;
}

Просмотреть файл

@ -1,6 +1,5 @@
const CHROME_PROCESS = E10SUtils.NOT_REMOTE;
const WEB_CONTENT_PROCESS = E10SUtils.WEB_REMOTE_TYPE;
const PRIVILEGED_CONTENT_PROCESS = E10SUtils.PRIVILEGED_REMOTE_TYPE;
const CHROME_PROCESS = Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
const CONTENT_PROCESS = Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT;
const CHROME = {
id: "cb34538a-d9da-40f3-b61a-069f0b2cb9fb",
@ -17,18 +16,11 @@ const MUSTREMOTE = {
path: "test-mustremote",
flags: Ci.nsIAboutModule.URI_MUST_LOAD_IN_CHILD,
};
const CANPRIVILEGEDREMOTE = {
id: "a04ffafe-6c63-4266-acae-0f4b093165aa",
path: "test-canprivilegedremote",
flags: Ci.nsIAboutModule.URI_MUST_LOAD_IN_CHILD |
Ci.nsIAboutModule.URI_CAN_LOAD_IN_PRIVILEGED_CHILD,
};
const TEST_MODULES = [
CHROME,
CANREMOTE,
MUSTREMOTE,
CANPRIVILEGEDREMOTE,
];
function AboutModule() {
@ -87,70 +79,36 @@ registerCleanupFunction(() => {
}
});
function test_url(url, chromeResult, webContentResult, privilegedContentResult) {
is(E10SUtils.canLoadURIInRemoteType(url, CHROME_PROCESS),
function test_url(url, chromeResult, contentResult) {
is(E10SUtils.canLoadURIInProcess(url, CHROME_PROCESS),
chromeResult, "Check URL in chrome process.");
is(E10SUtils.canLoadURIInRemoteType(url, WEB_CONTENT_PROCESS),
webContentResult, "Check URL in web content process.");
is(E10SUtils.canLoadURIInRemoteType(url, PRIVILEGED_CONTENT_PROCESS),
privilegedContentResult, "Check URL in privileged content process.");
is(E10SUtils.canLoadURIInProcess(url, CONTENT_PROCESS),
contentResult, "Check URL in content process.");
is(E10SUtils.canLoadURIInRemoteType(url + "#foo", CHROME_PROCESS),
is(E10SUtils.canLoadURIInProcess(url + "#foo", CHROME_PROCESS),
chromeResult, "Check URL with ref in chrome process.");
is(E10SUtils.canLoadURIInRemoteType(url + "#foo", WEB_CONTENT_PROCESS),
webContentResult, "Check URL with ref in web content process.");
is(E10SUtils.canLoadURIInRemoteType(url + "#foo", PRIVILEGED_CONTENT_PROCESS),
privilegedContentResult, "Check URL with ref in privileged content process.");
is(E10SUtils.canLoadURIInProcess(url + "#foo", CONTENT_PROCESS),
contentResult, "Check URL with ref in content process.");
is(E10SUtils.canLoadURIInRemoteType(url + "?foo", CHROME_PROCESS),
is(E10SUtils.canLoadURIInProcess(url + "?foo", CHROME_PROCESS),
chromeResult, "Check URL with query in chrome process.");
is(E10SUtils.canLoadURIInRemoteType(url + "?foo", WEB_CONTENT_PROCESS),
webContentResult, "Check URL with query in web content process.");
is(E10SUtils.canLoadURIInRemoteType(url + "?foo", PRIVILEGED_CONTENT_PROCESS),
privilegedContentResult, "Check URL with query in privileged content process.");
is(E10SUtils.canLoadURIInProcess(url + "?foo", CONTENT_PROCESS),
contentResult, "Check URL with query in content process.");
is(E10SUtils.canLoadURIInRemoteType(url + "?foo#bar", CHROME_PROCESS),
is(E10SUtils.canLoadURIInProcess(url + "?foo#bar", CHROME_PROCESS),
chromeResult, "Check URL with query and ref in chrome process.");
is(E10SUtils.canLoadURIInRemoteType(url + "?foo#bar", WEB_CONTENT_PROCESS),
webContentResult, "Check URL with query and ref in web content process.");
is(E10SUtils.canLoadURIInRemoteType(url + "?foo#bar", PRIVILEGED_CONTENT_PROCESS),
privilegedContentResult, "Check URL with query and ref in privileged content process.");
is(E10SUtils.canLoadURIInProcess(url + "?foo#bar", CONTENT_PROCESS),
contentResult, "Check URL with query and ref in content process.");
}
add_task(async function test_chrome() {
test_url("about:" + CHROME.path, true, false, false);
test_url("about:" + CHROME.path, true, false);
});
add_task(async function test_any() {
test_url("about:" + CANREMOTE.path, true, true, false);
test_url("about:" + CANREMOTE.path, true, true);
});
add_task(async function test_remote() {
test_url("about:" + MUSTREMOTE.path, false, true, false);
});
add_task(async function test_privileged_remote_true() {
await SpecialPowers.pushPrefEnv({
set: [
["browser.tabs.remote.separatePrivilegedContentProcess", true],
],
});
// This shouldn't be taken literally. We will always use the privileged
// content type if the URI_CAN_LOAD_IN_PRIVILEGED_CHILD flag is enabled and
// the pref is turned on.
test_url("about:" + CANPRIVILEGEDREMOTE.path, false, false, true);
});
add_task(async function test_privileged_remote_false() {
await SpecialPowers.pushPrefEnv({
set: [
["browser.tabs.remote.separatePrivilegedContentProcess", false],
],
});
// This shouldn't be taken literally. We will always use the privileged
// content type if the URI_CAN_LOAD_IN_PRIVILEGED_CHILD flag is enabled and
// the pref is turned on.
test_url("about:" + CANPRIVILEGEDREMOTE.path, false, true, false);
test_url("about:" + MUSTREMOTE.path, false, true);
});

Просмотреть файл

@ -32,8 +32,8 @@ function makeTest(name, startURL, startProcessIsRemote, endURL, endProcessIsRemo
};
}
const CHROME_PROCESS = E10SUtils.NOT_REMOTE;
const WEB_CONTENT_PROCESS = E10SUtils.WEB_REMOTE_TYPE;
const CHROME_PROCESS = Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
const CONTENT_PROCESS = Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT;
const PATH = (getRootDirectory(gTestPath) + "test_process_flags_chrome.html").replace("chrome://mochitests", "");
const CHROME = "chrome://mochitests" + PATH;
@ -49,25 +49,25 @@ registerCleanupFunction(() => {
});
function test_url(url, chromeResult, contentResult) {
is(E10SUtils.canLoadURIInRemoteType(url, CHROME_PROCESS),
is(E10SUtils.canLoadURIInProcess(url, CHROME_PROCESS),
chromeResult, "Check URL in chrome process.");
is(E10SUtils.canLoadURIInRemoteType(url, WEB_CONTENT_PROCESS),
contentResult, "Check URL in web content process.");
is(E10SUtils.canLoadURIInProcess(url, CONTENT_PROCESS),
contentResult, "Check URL in content process.");
is(E10SUtils.canLoadURIInRemoteType(url + "#foo", CHROME_PROCESS),
is(E10SUtils.canLoadURIInProcess(url + "#foo", CHROME_PROCESS),
chromeResult, "Check URL with ref in chrome process.");
is(E10SUtils.canLoadURIInRemoteType(url + "#foo", WEB_CONTENT_PROCESS),
contentResult, "Check URL with ref in web content process.");
is(E10SUtils.canLoadURIInProcess(url + "#foo", CONTENT_PROCESS),
contentResult, "Check URL with ref in content process.");
is(E10SUtils.canLoadURIInRemoteType(url + "?foo", CHROME_PROCESS),
is(E10SUtils.canLoadURIInProcess(url + "?foo", CHROME_PROCESS),
chromeResult, "Check URL with query in chrome process.");
is(E10SUtils.canLoadURIInRemoteType(url + "?foo", WEB_CONTENT_PROCESS),
contentResult, "Check URL with query in web content process.");
is(E10SUtils.canLoadURIInProcess(url + "?foo", CONTENT_PROCESS),
contentResult, "Check URL with query in content process.");
is(E10SUtils.canLoadURIInRemoteType(url + "?foo#bar", CHROME_PROCESS),
is(E10SUtils.canLoadURIInProcess(url + "?foo#bar", CHROME_PROCESS),
chromeResult, "Check URL with query and ref in chrome process.");
is(E10SUtils.canLoadURIInRemoteType(url + "?foo#bar", WEB_CONTENT_PROCESS),
contentResult, "Check URL with query and ref in web content process.");
is(E10SUtils.canLoadURIInProcess(url + "?foo#bar", CONTENT_PROCESS),
contentResult, "Check URL with query and ref in content process.");
}
add_task(async function test_chrome() {

Просмотреть файл

@ -1,11 +1,11 @@
const CHROME_PROCESS = E10SUtils.NOT_REMOTE;
const WEB_CONTENT_PROCESS = E10SUtils.WEB_REMOTE_TYPE;
const CHROME_PROCESS = Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
const CONTENT_PROCESS = Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT;
add_task(async function() {
let url = "javascript:dosomething()";
ok(E10SUtils.canLoadURIInRemoteType(url, CHROME_PROCESS),
ok(E10SUtils.canLoadURIInProcess(url, CHROME_PROCESS),
"Check URL in chrome process.");
ok(E10SUtils.canLoadURIInRemoteType(url, WEB_CONTENT_PROCESS),
"Check URL in web content process.");
ok(E10SUtils.canLoadURIInProcess(url, CONTENT_PROCESS),
"Check URL in content process.");
});

Просмотреть файл

@ -4,7 +4,7 @@
"use strict";
/**
* Unit tests for tabbrowser.isLocalAboutURI to make sure it returns the
* Unit tests for tabbrowser._isLocalAboutURI to make sure it returns the
* appropriate values for various URIs as well as optional resolved URI.
*/
@ -12,9 +12,9 @@ add_task(function test_URI() {
const check = (spec, expect, description) => {
const URI = Services.io.newURI(spec);
try {
is(gBrowser.isLocalAboutURI(URI), expect, description);
is(gBrowser._isLocalAboutURI(URI), expect, description);
} catch (ex) {
ok(false, "isLocalAboutURI should not throw");
ok(false, "_isLocalAboutURI should not throw");
}
};
check("https://www.mozilla.org/", false, "https is not about");
@ -30,7 +30,7 @@ add_task(function test_URI_with_resolved() {
const check = (spec, resolvedSpec, expect, description) => {
const URI = Services.io.newURI(spec);
const resolvedURI = Services.io.newURI(resolvedSpec);
is(gBrowser.isLocalAboutURI(URI, resolvedURI), expect, description);
is(gBrowser._isLocalAboutURI(URI, resolvedURI), expect, description);
};
check("about:newtab",
"jar:file:///Applications/Firefox.app/Contents/Resources/browser/omni.ja!/chrome/browser/res/activity-stream/prerendered/en-US/activity-stream.html",

Просмотреть файл

@ -30,7 +30,7 @@ const TEST_HTTP = "http://example.org/";
* do not match. If not present, it uses the default message defined
* in the function parameters.
*/
function checkBrowserRemoteType(
async function checkBrowserRemoteType(
browser,
expectedRemoteType,
message = `Ensures that tab runs in the ${expectedRemoteType} content process.`
@ -63,7 +63,7 @@ add_task(async function activity_stream_in_privileged_content_process() {
Services.ppmm.releaseCachedProcesses();
await BrowserTestUtils.withNewTab(ABOUT_NEWTAB, async function(browser1) {
checkBrowserRemoteType(browser1, E10SUtils.PRIVILEGED_REMOTE_TYPE);
await checkBrowserRemoteType(browser1, E10SUtils.PRIVILEGED_REMOTE_TYPE);
// Note the processID for about:newtab for comparison later.
let privilegedPid = browser1.frameLoader.tabParent.osPid;
@ -97,7 +97,7 @@ add_task(async function process_switching_through_loading_in_the_same_tab() {
Services.ppmm.releaseCachedProcesses();
await BrowserTestUtils.withNewTab(TEST_HTTP, async function(browser) {
checkBrowserRemoteType(browser, E10SUtils.WEB_REMOTE_TYPE);
await checkBrowserRemoteType(browser, E10SUtils.WEB_REMOTE_TYPE);
for (let [url, remoteType] of [
[ABOUT_NEWTAB, E10SUtils.PRIVILEGED_REMOTE_TYPE],
@ -123,7 +123,7 @@ add_task(async function process_switching_through_loading_in_the_same_tab() {
]) {
BrowserTestUtils.loadURI(browser, url);
await BrowserTestUtils.browserLoaded(browser, false, url);
checkBrowserRemoteType(browser, remoteType);
await checkBrowserRemoteType(browser, remoteType);
}
});
@ -139,7 +139,7 @@ add_task(async function process_switching_through_navigation_features() {
Services.ppmm.releaseCachedProcesses();
await BrowserTestUtils.withNewTab(ABOUT_NEWTAB, async function(browser) {
checkBrowserRemoteType(browser, E10SUtils.PRIVILEGED_REMOTE_TYPE);
await checkBrowserRemoteType(browser, E10SUtils.PRIVILEGED_REMOTE_TYPE);
// Note the processID for about:newtab for comparison later.
let privilegedPid = browser.frameLoader.tabParent.osPid;
@ -166,7 +166,7 @@ add_task(async function process_switching_through_navigation_features() {
// Load http webpage
BrowserTestUtils.loadURI(browser, TEST_HTTP);
await BrowserTestUtils.browserLoaded(browser, false, TEST_HTTP);
checkBrowserRemoteType(browser, E10SUtils.WEB_REMOTE_TYPE);
await checkBrowserRemoteType(browser, E10SUtils.WEB_REMOTE_TYPE);
// Check that using the history back feature switches back to privileged content process.
let promiseLocation = BrowserTestUtils.waitForLocationChange(gBrowser, ABOUT_NEWTAB);
@ -185,7 +185,7 @@ add_task(async function process_switching_through_navigation_features() {
// We will need to ensure that the process flip has fully completed so that
// the navigation history data will be available when we do browser.gotoIndex(0);
await BrowserTestUtils.waitForEvent(newTab, "SSTabRestored");
checkBrowserRemoteType(browser, E10SUtils.WEB_REMOTE_TYPE,
await checkBrowserRemoteType(browser, E10SUtils.WEB_REMOTE_TYPE,
"Check that tab runs in the web content process after using history goForward.");
// Check that goto history index does not break the affinity.
@ -197,7 +197,7 @@ add_task(async function process_switching_through_navigation_features() {
BrowserTestUtils.loadURI(browser, TEST_HTTP);
await BrowserTestUtils.browserLoaded(browser, false, TEST_HTTP);
checkBrowserRemoteType(browser, E10SUtils.WEB_REMOTE_TYPE);
await checkBrowserRemoteType(browser, E10SUtils.WEB_REMOTE_TYPE);
// Check that location change causes a change in process type as well.
await ContentTask.spawn(browser, ABOUT_NEWTAB, uri => {

Просмотреть файл

@ -108,7 +108,6 @@ AboutNewTabService.prototype = {
case "nsPref:changed":
if (data === PREF_SEPARATE_PRIVILEGED_CONTENT_PROCESS) {
this._privilegedContentProcess = Services.prefs.getBoolPref(PREF_SEPARATE_PRIVILEGED_CONTENT_PROCESS);
this.notifyChange();
} else if (data === PREF_ACTIVITY_STREAM_PRERENDER_ENABLED) {
this._activityStreamPrerender = Services.prefs.getBoolPref(PREF_ACTIVITY_STREAM_PRERENDER_ENABLED);
this.notifyChange();

Просмотреть файл

@ -4,9 +4,7 @@ XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
"nsIAboutNewTabService");
// Tests are by default run with non-debug en-US configuration
const DEFAULT_URL = SpecialPowers.getBoolPref("browser.tabs.remote.separatePrivilegedContentProcess")
? "resource://activity-stream/prerendered/en-US/activity-stream-prerendered-noscripts.html"
: "resource://activity-stream/prerendered/en-US/activity-stream-prerendered.html";
const DEFAULT_URL = "resource://activity-stream/prerendered/en-US/activity-stream-prerendered.html";
/**
* Temporarily change the app locale to get the localized activity stream url

Просмотреть файл

@ -14,13 +14,16 @@ XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
const IS_RELEASE_OR_BETA = AppConstants.RELEASE_OR_BETA;
const ACTIVITY_STREAM_PRERENDER_URL = "resource://activity-stream/prerendered/en-US/activity-stream-prerendered.html";
const ACTIVITY_STREAM_PRERENDER_DEBUG_URL = "resource://activity-stream/prerendered/static/activity-stream-prerendered-debug.html";
const ACTIVITY_STREAM_URL = "resource://activity-stream/prerendered/en-US/activity-stream.html";
const ACTIVITY_STREAM_DEBUG_URL = "resource://activity-stream/prerendered/static/activity-stream-debug.html";
const DOWNLOADS_URL = "chrome://browser/content/downloads/contentAreaDownloadsView.xul";
const SEPARATE_PRIVILEGED_CONTENT_PROCESS_PREF = "browser.tabs.remote.separatePrivilegedContentProcess";
const ACTIVITY_STREAM_PRERENDER_PREF = "browser.newtabpage.activity-stream.prerender";
const ACTIVITY_STREAM_DEBUG_PREF = "browser.newtabpage.activity-stream.debug";
function cleanup() {
Services.prefs.clearUserPref(SEPARATE_PRIVILEGED_CONTENT_PROCESS_PREF);
Services.prefs.clearUserPref(ACTIVITY_STREAM_PRERENDER_PREF);
Services.prefs.clearUserPref(ACTIVITY_STREAM_DEBUG_PREF);
aboutNewTabService.resetNewTabURL();
@ -28,41 +31,6 @@ function cleanup() {
registerCleanupFunction(cleanup);
let ACTIVITY_STREAM_PRERENDER_URL;
let ACTIVITY_STREAM_PRERENDER_DEBUG_URL;
let ACTIVITY_STREAM_URL;
let ACTIVITY_STREAM_DEBUG_URL;
function setExpectedUrlsWithScripts() {
ACTIVITY_STREAM_PRERENDER_URL = "resource://activity-stream/prerendered/en-US/activity-stream-prerendered.html";
ACTIVITY_STREAM_PRERENDER_DEBUG_URL = "resource://activity-stream/prerendered/static/activity-stream-prerendered-debug.html";
ACTIVITY_STREAM_URL = "resource://activity-stream/prerendered/en-US/activity-stream.html";
ACTIVITY_STREAM_DEBUG_URL = "resource://activity-stream/prerendered/static/activity-stream-debug.html";
}
function setExpectedUrlsWithoutScripts() {
ACTIVITY_STREAM_PRERENDER_URL = "resource://activity-stream/prerendered/en-US/activity-stream-prerendered-noscripts.html";
ACTIVITY_STREAM_PRERENDER_DEBUG_URL = "resource://activity-stream/prerendered/static/activity-stream-prerendered-debug-noscripts.html";
ACTIVITY_STREAM_URL = "resource://activity-stream/prerendered/en-US/activity-stream-noscripts.html";
ACTIVITY_STREAM_DEBUG_URL = "resource://activity-stream/prerendered/static/activity-stream-debug-noscripts.html";
}
// Default expected URLs to files with scripts in them.
setExpectedUrlsWithScripts();
function addTestsWithPrivilegedContentProcessPref(test) {
add_task(async() => {
await setPrivilegedContentProcessPref(true);
setExpectedUrlsWithoutScripts();
await test();
});
add_task(async() => {
await setPrivilegedContentProcessPref(false);
setExpectedUrlsWithScripts();
await test();
});
}
function nextChangeNotificationPromise(aNewURL, testMessage) {
return new Promise(resolve => {
Services.obs.addObserver(function observer(aSubject, aTopic, aData) { // jshint unused:false
@ -95,16 +63,6 @@ function setupASPrerendered() {
return notificationPromise;
}
function setPrivilegedContentProcessPref(usePrivilegedContentProcess) {
if (usePrivilegedContentProcess === Services.prefs.getBoolPref(SEPARATE_PRIVILEGED_CONTENT_PROCESS_PREF)) {
return Promise.resolve();
}
let notificationPromise = nextChangeNotificationPromise("about:newtab");
Services.prefs.setBoolPref(SEPARATE_PRIVILEGED_CONTENT_PROCESS_PREF, usePrivilegedContentProcess);
return notificationPromise;
}
add_task(async function test_as_and_prerender_initialized() {
Assert.ok(aboutNewTabService.activityStreamEnabled,
".activityStreamEnabled should be set to the correct initial value");
@ -147,11 +105,10 @@ add_task(async function test_override_activity_stream_disabled() {
cleanup();
});
addTestsWithPrivilegedContentProcessPref(async function test_override_activity_stream_enabled() {
add_task(async function test_override_activity_stream_enabled() {
let notificationPromise = await setupASPrerendered();
Assert.equal(aboutNewTabService.defaultURL, ACTIVITY_STREAM_PRERENDER_URL,
"Newtab URL should be the default activity stream prerendered URL");
Assert.equal(aboutNewTabService.defaultURL, ACTIVITY_STREAM_PRERENDER_URL, "Newtab URL should be the default activity stream prerendered URL");
Assert.ok(!aboutNewTabService.overridden, "Newtab URL should not be overridden");
Assert.ok(aboutNewTabService.activityStreamEnabled, "Activity Stream should be enabled");
Assert.ok(aboutNewTabService.activityStreamPrerender, "Activity Stream should be prerendered");
@ -170,9 +127,8 @@ addTestsWithPrivilegedContentProcessPref(async function test_override_activity_s
cleanup();
});
addTestsWithPrivilegedContentProcessPref(async function test_default_url() {
add_task(async function test_default_url() {
await setupASPrerendered();
Assert.equal(aboutNewTabService.defaultURL, ACTIVITY_STREAM_PRERENDER_URL,
"Newtab defaultURL initially set to prerendered AS url");
@ -205,7 +161,7 @@ addTestsWithPrivilegedContentProcessPref(async function test_default_url() {
cleanup();
});
addTestsWithPrivilegedContentProcessPref(async function test_welcome_url() {
add_task(async function test_welcome_url() {
await setupASPrerendered();
Assert.equal(aboutNewTabService.activityStreamPrerender, true,
@ -238,11 +194,11 @@ add_task(function test_locale() {
});
/**
* Tests response to updates to prefs
* Tests reponse to updates to prefs
*/
addTestsWithPrivilegedContentProcessPref(async function test_updates() {
// Simulates a "cold-boot" situation, with some pref already set before testing a series
// of changes.
add_task(async function test_updates() {
// Simulates a "cold-boot" situation, with some pref already set before testing a series
// of changes.
await setupASPrerendered();
aboutNewTabService.resetNewTabURL(); // need to set manually because pref notifs are off

Просмотреть файл

@ -2436,17 +2436,8 @@ var SessionStoreInternal = {
let newTab = aWindow.gBrowser.addTrustedTab(null, tabOptions);
// Start the throbber to pretend we're doing something while actually
// waiting for data from the frame script. This throbber is disabled
// if the URI is a local about: URI.
let uriObj = aTab.linkedBrowser.currentURI;
if (!uriObj || (uriObj && !aWindow.gBrowser.isLocalAboutURI(uriObj))) {
newTab.setAttribute("busy", "true");
}
// Hack to ensure that the about:home, about:newtab, and about:welcome
// favicon is loaded instantaneously, to avoid flickering and improve
// perceived performance.
aWindow.gBrowser.setDefaultIcon(newTab, uriObj);
// waiting for data from the frame script.
newTab.setAttribute("busy", "true");
// Collect state before flushing.
let tabState = TabState.collect(aTab, TAB_CUSTOM_VALUES.get(aTab));
@ -2783,14 +2774,7 @@ var SessionStoreInternal = {
// Restore the tab icon.
if ("image" in tabData) {
// We know that about:blank is safe to load in any remote type. Since
// SessionStore is triggered with about:blank, there must be a process
// flip. We will ignore the first about:blank load to prevent resetting the
// favicon that we have set earlier to avoid flickering and improve
// perceived performance.
if (!activePageData || (activePageData && activePageData.url != "about:blank")) {
win.gBrowser.setIcon(tab, tabData.image, undefined, tabData.iconLoadingPrincipal);
}
win.gBrowser.setIcon(tab, tabData.image, undefined, tabData.iconLoadingPrincipal);
TabStateCache.update(browser, { image: null, iconLoadingPrincipal: null });
}
},
@ -3030,22 +3014,9 @@ var SessionStoreInternal = {
return;
}
let uriObj;
try {
uriObj = Services.io.newURI(loadArguments.uri);
} catch (e) {}
// Start the throbber to pretend we're doing something while actually
// waiting for data from the frame script. This throbber is disabled
// if the URI is a local about: URI.
if (!uriObj || (uriObj && !window.gBrowser.isLocalAboutURI(uriObj))) {
tab.setAttribute("busy", "true");
}
// Hack to ensure that the about:home, about:newtab, and about:welcome
// favicon is loaded instantaneously, to avoid flickering and improve
// perceived performance.
window.gBrowser.setDefaultIcon(tab, uriObj);
// waiting for data from the frame script.
tab.setAttribute("busy", "true");
// Flush to get the latest tab state.
TabStateFlusher.flush(browser).then(() => {
@ -4071,7 +4042,7 @@ var SessionStoreInternal = {
requestTime: Services.telemetry.msSystemNow()});
// Focus the tab's content area.
if (aTab.selected && !window.isBlankPageURL(uri)) {
if (aTab.selected) {
browser.focus();
}
},

Просмотреть файл

@ -1365,12 +1365,12 @@ var UITour = {
},
showNewTab(aWindow, aBrowser) {
aWindow.gURLBar.focus();
let url = "about:newtab";
aWindow.openLinkIn(url, "current", {
targetBrowser: aBrowser,
triggeringPrincipal: Services.scriptSecurityManager.createCodebasePrincipal(Services.io.newURI(url), {}),
});
aWindow.gURLBar.focus();
},
_hideAnnotationsForPanel(aEvent, aShouldClosePanel, aTargetPositionCallback) {

Просмотреть файл

@ -353,7 +353,7 @@ class AsyncTabSwitcher {
// determined by the busy state on the tab element and checking
// if the loaded URI is local.
let hasSufficientlyLoaded = !this.requestedTab.hasAttribute("busy") &&
!this.tabbrowser.isLocalAboutURI(requestedBrowser.currentURI);
!this.tabbrowser._isLocalAboutURI(requestedBrowser.currentURI);
let fl = requestedBrowser.frameLoader;
shouldBeBlank = !this.minimizedOrFullyOccluded &&

Просмотреть файл

@ -106,18 +106,12 @@ function swapToInnerBrowser({ tab, containerURL, getInnerBrowser }) {
async start() {
// In some cases, such as a preloaded browser used for about:newtab, browser code
// will force a new frameloader on next navigation to remote content to ensure
// balanced process assignment. If this case will happen here, navigate to
// about:blank first to get this out of way so that we stay within one process while
// RDM is open. Some process selection rules are specific to remote content, so we
// use `http://example.com` as a test for what a remote navigation would cause.
const {
requiredRemoteType,
mustChangeProcess,
newFrameloader
} = E10SUtils.shouldLoadURIInBrowser(
tab.linkedBrowser,
"http://example.com"
// will force a new frameloader on next navigation to ensure balanced process
// assignment. If this case will happen here, navigate to about:blank first to get
// this out of way so that we stay within one process while RDM is open.
const { newFrameloader } = E10SUtils.shouldLoadURIInBrowser(
tab.linkedBrowser,
"about:blank"
);
if (newFrameloader) {
debug(`Tab will force a new frameloader on navigation, load about:blank first`);
@ -126,12 +120,6 @@ function swapToInnerBrowser({ tab, containerURL, getInnerBrowser }) {
triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({}),
});
}
if (mustChangeProcess) {
debug(`Tab will force a process flip on navigation, load about:blank first`);
gBrowser.updateBrowserRemoteness(tab.linkedBrowser, true, {
remoteType: requiredRemoteType,
});
}
tab.isResponsiveDesignMode = true;

Просмотреть файл

@ -11,10 +11,10 @@ add_task(async function test() {
const url = "http://mochi.test:8888/browser/dom/xhr/tests/browser_xhr_onchange_leak.html";
let newTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, url);
let browser = gBrowser.selectedBrowser;
let done = await ContentTask.spawn(browser, {}, async function(browser) {
let done = await ContentTask.spawn(browser,{}, async function(browser){
let doc = content.document;
let promise = ContentTaskUtils.waitForEvent(this, "DOMContentLoaded", true);
content.location = "http://example.org/";
content.location = "about:home";
await promise;
return true;
});

Просмотреть файл

@ -10,17 +10,17 @@ add_task(async function test() {
let newTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, url);
let browser = gBrowser.selectedBrowser;
let innerWindowId = browser.innerWindowID;
let contentDocDead = await ContentTask.spawn(browser, {innerWindowId}, async function(args) {
let contentDocDead = await ContentTask.spawn(browser,{innerWindowId}, async function(args){
let doc = content.document;
let {TestUtils} = ChromeUtils.import("resource://testing-common/TestUtils.jsm", {});
let promise = TestUtils.topicObserved("inner-window-nuked", (subject, data) => {
let id = subject.QueryInterface(Ci.nsISupportsPRUint64).data;
return id == args.innerWindowId;
});
content.location = "http://example.org/";
content.location = "about:home";
await promise;
return Cu.isDeadWrapper(doc);
});
is(contentDocDead, true, "wrapper is dead");
BrowserTestUtils.removeTab(newTab);
BrowserTestUtils.removeTab(newTab);
});

Просмотреть файл

@ -594,8 +594,12 @@ var BrowserTestUtils = {
if (url) {
let browser = win.gBrowser.selectedBrowser;
// Retrieve the given browser's current process type.
let process =
browser.isRemoteBrowser ? Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT
: Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
if (win.gMultiProcessBrowser &&
!E10SUtils.canLoadURIInRemoteType(url, browser.remoteType)) {
!E10SUtils.canLoadURIInProcess(url, process)) {
await this.waitForEvent(browser, "XULFrameLoaderCreated");
}
@ -638,10 +642,14 @@ var BrowserTestUtils = {
return;
}
// Retrieve the given browser's current process type.
let process = browser.isRemoteBrowser ? Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT
: Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
// If the new URI can't load in the browser's current process then we
// should wait for the new frameLoader to be created. This will happen
// asynchronously when the browser's remoteness changes.
if (!E10SUtils.canLoadURIInRemoteType(uri, browser.remoteType)) {
if (!E10SUtils.canLoadURIInProcess(uri, process)) {
await this.waitForEvent(browser, "XULFrameLoaderCreated");
}
},

Просмотреть файл

@ -2,7 +2,7 @@
ChromeUtils.import("resource://gre/modules/Timer.jsm", this);
const TEST_PAGE_URI = "data:text/html;charset=utf-8,The letter s.";
// Using 'javascript' schema to bypass E10SUtils.canLoadURIInRemoteType, because
// Using 'javascript' schema to bypass E10SUtils.canLoadURIInProcess, because
// it does not allow 'data:' URI to be loaded in the parent process.
const E10S_PARENT_TEST_PAGE_URI = "javascript:document.write('The letter s.');";

Просмотреть файл

@ -90,14 +90,10 @@ var E10SUtils = {
PRIVILEGED_REMOTE_TYPE,
LARGE_ALLOCATION_REMOTE_TYPE,
canLoadURIInRemoteType(aURL, aRemoteType = DEFAULT_REMOTE_TYPE) {
// We need a strict equality here because the value of `NOT_REMOTE` is
// `null`, and there is a possibility that `undefined` is passed as the
// second argument, which might result a load in the parent process.
let preferredRemoteType = aRemoteType === NOT_REMOTE
? NOT_REMOTE
: DEFAULT_REMOTE_TYPE;
return aRemoteType == this.getRemoteTypeForURI(aURL, true, preferredRemoteType);
canLoadURIInProcess(aURL, aProcess) {
let remoteType = aProcess == Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT
? DEFAULT_REMOTE_TYPE : NOT_REMOTE;
return remoteType == this.getRemoteTypeForURI(aURL, true, remoteType);
},
getRemoteTypeForURI(aURL, aMultiProcess,

Просмотреть файл

@ -3061,9 +3061,10 @@ var gDetailView = {
let policy = ExtensionParent.WebExtensionPolicy.getByID(this._addon.id);
browser.sameProcessAsFrameLoader = policy.extension.groupFrameLoader;
}
let remote = !E10SUtils.canLoadURIInProcess(optionsURL, Services.appinfo.PROCESS_TYPE_DEFAULT);
let readyPromise;
if (E10SUtils.canLoadURIInRemoteType(optionsURL, E10SUtils.EXTENSION_REMOTE_TYPE)) {
if (remote) {
browser.setAttribute("remote", "true");
browser.setAttribute("remoteType", E10SUtils.EXTENSION_REMOTE_TYPE);
readyPromise = promiseEvent("XULFrameLoaderCreated", browser);