Backed out 2 changesets (bug 1365643) for frequent failures in browser_forget_async_closings.js on Windows a=backout CLOSED TREE

Backed out changeset c5e8b08a4635 (bug 1365643)
Backed out changeset 9377a56fe004 (bug 1365643)
This commit is contained in:
Wes Kocher 2017-06-23 14:57:22 -07:00
Родитель ea40157e54
Коммит e423d726ed
6 изменённых файлов: 62 добавлений и 6 удалений

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

@ -22,6 +22,7 @@ namespace browser {
NS_IMPL_ISUPPORTS(AboutRedirector, nsIAboutModule)
bool AboutRedirector::sUseOldPreferences = false;
bool AboutRedirector::sActivityStreamEnabled = false;
struct RedirEntry {
const char* id;
@ -206,8 +207,26 @@ AboutRedirector::GetURIFlags(nsIURI *aURI, uint32_t *result)
nsAutoCString name = GetAboutModuleName(aURI);
static bool sASEnabledCacheInited = false;
if (!sASEnabledCacheInited) {
Preferences::AddBoolVarCache(&sActivityStreamEnabled,
"browser.newtabpage.activity-stream.enabled");
sASEnabledCacheInited = true;
}
for (auto & redir : kRedirMap) {
if (name.Equals(redir.id)) {
// Once ActivityStream is fully rolled out and we've removed Tiles,
// this special case can go away and the flag can just become part
// of the normal about:newtab entry in kRedirMap.
if (name.EqualsLiteral("newtab")) {
if (sActivityStreamEnabled) {
*result = redir.flags | nsIAboutModule::URI_MUST_LOAD_IN_CHILD;
return NS_OK;
}
}
*result = redir.flags;
return NS_OK;
}

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

@ -27,6 +27,7 @@ protected:
private:
static bool sUseOldPreferences;
static bool sActivityStreamEnabled;
};
} // namespace browser

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

@ -11,6 +11,8 @@ EXPORTS.mozilla.browser += [
'AboutRedirector.h',
]
XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
SOURCES += [
'AboutRedirector.cpp',
]

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

@ -0,0 +1,33 @@
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/Services.jsm");
const contract = "@mozilla.org/network/protocol/about;1?what=newtab";
const am = Cc[contract].getService(Ci.nsIAboutModule);
const uri = Services.io.newURI("about:newtab");
function run_test() {
test_AS_enabled_flags();
test_AS_disabled_flags();
}
// Since tiles isn't e10s capable, it shouldn't advertise that it can load in
// the child.
function test_AS_disabled_flags() {
Services.prefs.setBoolPref("browser.newtabpage.activity-stream.enabled",
false);
let flags = am.getURIFlags(uri);
ok(!(flags & Ci.nsIAboutModule.URI_MUST_LOAD_IN_CHILD));
}
// Activity Stream, however, is e10s-capable, and should advertise it.
function test_AS_enabled_flags() {
Services.prefs.setBoolPref("browser.newtabpage.activity-stream.enabled",
true);
let flags = am.getURIFlags(uri);
ok(flags & Ci.nsIAboutModule.URI_MUST_LOAD_IN_CHILD);
}

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

@ -0,0 +1,6 @@
[DEFAULT]
head =
# make the firefox services (eg newtab-service) available to xpcshell
firefox-appdir = browser
[test_getURIFlags.js]

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

@ -242,12 +242,7 @@ add_task(async function test_preload_crash() {
// Create a fresh preloaded browser
gBrowser._createPreloadBrowser();
// XXX Temporarily disabled until bug 1365643 relands. At that time, this
// this statement, as well as the eslint-disable-line below, should be
// removed.
return;
await BrowserTestUtils.crashBrowser(gBrowser._preloadedBrowser, false); // eslint-disable-line no-unreachable
await BrowserTestUtils.crashBrowser(gBrowser._preloadedBrowser, false);
Assert.ok(!gBrowser._preloadedBrowser);
});