author | Ed Lee <edilee@mozilla.com> |
Tue, 13 Feb 2018 16:53:50 -0800 | |
changeset 403999 | 088e727e5cf7591efaa542cfb256e83992388b13 |
parent 403998 | f3069763fab63f7c39d1cff9c54b1f32caf2ef5f |
child 404000 | 7ee5aabe89ef6ea406157bec38c060fa91a9153b |
push id | 33450 |
push user | nbeleuzu@mozilla.com |
push date | Fri, 16 Feb 2018 09:48:23 +0000 |
treeherder | mozilla-central@6ba349d419dd [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | ursula |
bugs | 1433324 |
milestone | 60.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -1281,18 +1281,17 @@ pref("browser.newtabpage.thumbnailPlaceh pref("browser.newtabpage.rows", 3); // number of columns of newtab grid pref("browser.newtabpage.columns", 5); // directory tiles download URL pref("browser.newtabpage.directory.source", "https://tiles.services.mozilla.com/v3/links/fetch/%LOCALE%/%CHANNEL%"); -// activates Activity Stream -pref("browser.newtabpage.activity-stream.enabled", true); +// Activity Stream prefs that control to which page to redirect pref("browser.newtabpage.activity-stream.prerender", true); #ifndef RELEASE_OR_BETA pref("browser.newtabpage.activity-stream.debug", false); #endif pref("browser.library.activity-stream.enabled", true); // Enable the DOM fullscreen API.
--- a/browser/base/content/browser-thumbnails.js +++ b/browser/base/content/browser-thumbnails.js @@ -9,23 +9,16 @@ * Keeps thumbnails of open web pages up-to-date. */ var gBrowserThumbnails = { /** * Pref that controls whether we can store SSL content on disk */ PREF_DISK_CACHE_SSL: "browser.cache.disk_cache_ssl", - /** - * Pref that controls whether activity stream is enabled - */ - PREF_ACTIVITY_STREAM_ENABLED: "browser.newtabpage.activity-stream.enabled", - - _activityStreamEnabled: null, - _captureDelayMS: 1000, /** * Used to keep track of disk_cache_ssl preference */ _sslDiskCacheEnabled: null, /** @@ -41,34 +34,30 @@ var gBrowserThumbnails = { /** * List of tab events we want to listen for. */ _tabEvents: ["TabClose", "TabSelect"], init: function Thumbnails_init() { gBrowser.addTabsProgressListener(this); Services.prefs.addObserver(this.PREF_DISK_CACHE_SSL, this); - Services.prefs.addObserver(this.PREF_ACTIVITY_STREAM_ENABLED, this); this._sslDiskCacheEnabled = Services.prefs.getBoolPref(this.PREF_DISK_CACHE_SSL); - this._activityStreamEnabled = - Services.prefs.getBoolPref(this.PREF_ACTIVITY_STREAM_ENABLED); this._tabEvents.forEach(function(aEvent) { gBrowser.tabContainer.addEventListener(aEvent, this); }, this); this._timeouts = new WeakMap(); }, uninit: function Thumbnails_uninit() { gBrowser.removeTabsProgressListener(this); Services.prefs.removeObserver(this.PREF_DISK_CACHE_SSL, this); - Services.prefs.removeObserver(this.PREF_ACTIVITY_STREAM_ENABLED, this); if (this._topSiteURLsRefreshTimer) { this._topSiteURLsRefreshTimer.cancel(); this._topSiteURLsRefreshTimer = null; } this._tabEvents.forEach(function(aEvent) { gBrowser.tabContainer.removeEventListener(aEvent, this); @@ -93,22 +82,16 @@ var gBrowserThumbnails = { }, observe: function Thumbnails_observe(subject, topic, data) { switch (data) { case this.PREF_DISK_CACHE_SSL: this._sslDiskCacheEnabled = Services.prefs.getBoolPref(this.PREF_DISK_CACHE_SSL); break; - case this.PREF_ACTIVITY_STREAM_ENABLED: - this._activityStreamEnabled = - Services.prefs.getBoolPref(this.PREF_ACTIVITY_STREAM_ENABLED); - // Get the new top sites - this.clearTopSiteURLCache(); - break; } }, clearTopSiteURLCache: function Thumbnails_clearTopSiteURLCache() { if (this._topSiteURLsRefreshTimer) { this._topSiteURLsRefreshTimer.cancel(); this._topSiteURLsRefreshTimer = null; } @@ -204,25 +187,21 @@ async function getTopSiteURLs() { // change frequently on new profiles, so as a compromise we cache its return // value as a lazy getter for 1 minute every time it's called. gBrowserThumbnails._topSiteURLsRefreshTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer); gBrowserThumbnails._topSiteURLsRefreshTimer.initWithCallback(gBrowserThumbnails, 60 * 1000, Ci.nsITimer.TYPE_ONE_SHOT); let sites = []; - if (gBrowserThumbnails._activityStreamEnabled) { - // Get both the top sites returned by the query, and also any pinned sites - // that the user might have added manually that also need a screenshot. - // Also include top sites that don't have rich icons - let topSites = await NewTabUtils.activityStreamLinks.getTopSites(); - sites.push(...topSites.filter(link => !(link.faviconSize >= 96))); - sites.push(...NewTabUtils.pinnedLinks.links); - } else { - sites = NewTabUtils.links.getLinks(); - } + // Get both the top sites returned by the query, and also any pinned sites + // that the user might have added manually that also need a screenshot. + // Also include top sites that don't have rich icons + let topSites = await NewTabUtils.activityStreamLinks.getTopSites(); + sites.push(...topSites.filter(link => !(link.faviconSize >= 96))); + sites.push(...NewTabUtils.pinnedLinks.links); return sites.reduce((urls, link) => { if (link) urls.push(link.url); return urls; }, []); } XPCOMUtils.defineLazyGetter(gBrowserThumbnails, "_topSiteURLs", getTopSiteURLs);
--- a/browser/base/content/test/general/browser_bug724239.js +++ b/browser/base/content/test/general/browser_bug724239.js @@ -6,31 +6,19 @@ add_task(async function test_blank() { async function(browser) { BrowserTestUtils.loadURI(browser, "http://example.com"); await BrowserTestUtils.browserLoaded(browser); ok(!gBrowser.canGoBack, "about:blank wasn't added to session history"); }); }); add_task(async function test_newtab() { - await SpecialPowers.pushPrefEnv({set: [["browser.newtabpage.activity-stream.enabled", true]]}); await BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank" }, async function(browser) { // Can't load it directly because that'll use a preloaded tab if present. BrowserTestUtils.loadURI(browser, "about:newtab"); await BrowserTestUtils.browserLoaded(browser); BrowserTestUtils.loadURI(browser, "http://example.com"); await BrowserTestUtils.browserLoaded(browser); is(gBrowser.canGoBack, true, "about:newtab was added to the session history when AS was enabled."); }); - await SpecialPowers.pushPrefEnv({set: [["browser.newtabpage.activity-stream.enabled", false]]}); - await BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank" }, - async function(browser) { - // Can't load it directly because that'll use a preloaded tab if present. - BrowserTestUtils.loadURI(browser, "about:newtab"); - await BrowserTestUtils.browserLoaded(browser); - - BrowserTestUtils.loadURI(browser, "http://example.com"); - await BrowserTestUtils.browserLoaded(browser); - is(gBrowser.canGoBack, false, "about:newtab was not added to the session history when AS was disabled."); - }); });
--- a/browser/base/content/test/general/browser_testOpenNewRemoteTabsFromNonRemoteBrowsers.js +++ b/browser/base/content/test/general/browser_testOpenNewRemoteTabsFromNonRemoteBrowsers.js @@ -6,17 +6,17 @@ const OPEN_LOCATION_PREF = "browser.link const NON_REMOTE_PAGE = "about:welcomeback"; ChromeUtils.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); requestLongerTimeout(2); function frame_script() { content.document.body.innerHTML = ` - <a href="about:home" target="_blank" id="testAnchor">Open a window</a> + <a href="http://example.com/" target="_blank" id="testAnchor">Open a window</a> `; let element = content.document.getElementById("testAnchor"); element.click(); } /** * Takes some browser in some window, and forces that browser @@ -57,17 +57,17 @@ add_task(async function test_new_tab() { let mm = testBrowser.messageManager; mm.loadFrameScript("data:,(" + frame_script.toString() + ")();", true); let tabOpenEvent = await waitForNewTabEvent(testWindow.gBrowser); let newTab = tabOpenEvent.target; await promiseTabLoadEvent(newTab); - // Our framescript opens to about:home which means that the + // Our framescript opens to a web page which means that the // tab should eventually become remote. ok(newTab.linkedBrowser.isRemoteBrowser, "The opened browser never became remote."); testWindow.gBrowser.removeTab(newTab); } normalWindow.close(); @@ -109,17 +109,17 @@ add_task(async function test_new_window( is(PrivateBrowsingUtils.isWindowPrivate(testWindow), PrivateBrowsingUtils.isWindowPrivate(newWindow), "Private browsing state of new window does not match the original!"); let newTab = newWindow.gBrowser.selectedTab; await promiseTabLoadEvent(newTab); - // Our framescript opens to about:home which means that the + // Our framescript opens to a web page which means that the // tab should eventually become remote. ok(newTab.linkedBrowser.isRemoteBrowser, "The opened browser never became remote."); newWindow.close(); } normalWindow.close(); privateWindow.close();
--- a/browser/base/content/test/newtab/browser.ini +++ b/browser/base/content/test/newtab/browser.ini @@ -1,10 +1,10 @@ [DEFAULT] -skip-if = (os == 'linux') # Bug 1243103, Bug 1243398, etc. +skip-if = true # Bug 1433133 to remove; previously skipped for intermittents, e.g., Bug 1243103, Bug 1243398 support-files = head.js [browser_newtab_1188015.js] [browser_newtab_background_captures.js] [browser_newtab_block.js] [browser_newtab_bug721442.js] [browser_newtab_bug722273.js]
--- a/browser/base/content/test/newtab/head.js +++ b/browser/base/content/test/newtab/head.js @@ -1,17 +1,15 @@ /* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ const PREF_NEWTAB_ENABLED = "browser.newtabpage.enabled"; const PREF_NEWTAB_DIRECTORYSOURCE = "browser.newtabpage.directory.source"; -const PREF_NEWTAB_ACTIVITY_STREAM = "browser.newtabpage.activity-stream.enabled"; Services.prefs.setBoolPref(PREF_NEWTAB_ENABLED, true); -Services.prefs.setBoolPref(PREF_NEWTAB_ACTIVITY_STREAM, false); // Opens and closes a new tab to clear any existing preloaded ones. This is // necessary to prevent any left-over activity-stream preloaded new tabs from // affecting these tests. BrowserOpenTab(); const initialTab = gBrowser.selectedTab; gBrowser.removeTab(initialTab); @@ -91,17 +89,16 @@ add_task(async function setupWindowSize( } }); }); }); }); registerCleanupFunction(function() { Services.prefs.clearUserPref(PREF_NEWTAB_ENABLED); - Services.prefs.clearUserPref(PREF_NEWTAB_ACTIVITY_STREAM); Services.prefs.setCharPref(PREF_NEWTAB_DIRECTORYSOURCE, gOrigDirectorySource); return watchLinksChangeOnce(); }); function pushPrefs(...aPrefs) { return SpecialPowers.pushPrefEnv({"set": aPrefs}); }
--- a/browser/components/about/AboutRedirector.cpp +++ b/browser/components/about/AboutRedirector.cpp @@ -16,18 +16,16 @@ #include "mozilla/Preferences.h" #include "nsServiceManagerUtils.h" namespace mozilla { namespace browser { NS_IMPL_ISUPPORTS(AboutRedirector, nsIAboutModule) -bool AboutRedirector::sActivityStreamEnabled = false; - struct RedirEntry { const char* id; const char* url; uint32_t flags; }; /* Entries which do not have URI_SAFE_FOR_UNTRUSTED_CONTENT will run with chrome @@ -71,25 +69,28 @@ static const RedirEntry kRedirMap[] = { nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT }, { "sessionrestore", "chrome://browser/content/aboutSessionRestore.xhtml", nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT }, { "welcomeback", "chrome://browser/content/aboutWelcomeBack.xhtml", nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT }, + // Actual activity stream URL for home and newtab are set in channel creation // Linkable because of indexeddb use (bug 1228118) - { "home", "chrome://browser/content/abouthome/aboutHome.xhtml", + { "home", "about:blank", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::URI_MUST_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::MAKE_LINKABLE | nsIAboutModule::ENABLE_INDEXED_DB }, - // the newtab's actual URL will be determined when the channel is created { "newtab", "about:blank", + nsIAboutModule::ENABLE_INDEXED_DB | + nsIAboutModule::URI_MUST_LOAD_IN_CHILD | + nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::ALLOW_SCRIPT }, { "preferences", "chrome://browser/content/preferences/in-content/preferences.xul", nsIAboutModule::ALLOW_SCRIPT }, { "downloads", "chrome://browser/content/downloads/contentAreaDownloadsView.xul", nsIAboutModule::ALLOW_SCRIPT }, { "reader", "chrome://global/content/reader/aboutReader.html", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::ALLOW_SCRIPT | @@ -110,51 +111,37 @@ GetAboutModuleName(nsIURI *aURI) f = path.FindChar('?'); if (f >= 0) path.SetLength(f); ToLowerCase(path); return path; } -void -AboutRedirector::LoadActivityStreamPrefs() -{ - static bool sASEnabledCacheInited = false; - if (!sASEnabledCacheInited) { - Preferences::AddBoolVarCache(&AboutRedirector::sActivityStreamEnabled, - "browser.newtabpage.activity-stream.enabled"); - sASEnabledCacheInited = true; - } -} - NS_IMETHODIMP AboutRedirector::NewChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo, nsIChannel** result) { NS_ENSURE_ARG_POINTER(aURI); NS_ENSURE_ARG_POINTER(aLoadInfo); NS_ASSERTION(result, "must not be null"); nsAutoCString path = GetAboutModuleName(aURI); nsresult rv; nsCOMPtr<nsIIOService> ioService = do_GetIOService(&rv); NS_ENSURE_SUCCESS(rv, rv); - LoadActivityStreamPrefs(); - for (auto & redir : kRedirMap) { if (!strcmp(path.get(), redir.id)) { nsAutoCString url; - if (path.EqualsLiteral("newtab") || - (path.EqualsLiteral("home") && sActivityStreamEnabled)) { + if (path.EqualsLiteral("newtab") || path.EqualsLiteral("home")) { // let the aboutNewTabService decide where to redirect nsCOMPtr<nsIAboutNewTabService> aboutNewTabService = do_GetService("@mozilla.org/browser/aboutnewtab-service;1", &rv); NS_ENSURE_SUCCESS(rv, rv); rv = aboutNewTabService->GetDefaultURL(url); NS_ENSURE_SUCCESS(rv, rv); } // fall back to the specified url in the map @@ -196,34 +183,18 @@ AboutRedirector::NewChannel(nsIURI* aURI NS_IMETHODIMP AboutRedirector::GetURIFlags(nsIURI *aURI, uint32_t *result) { NS_ENSURE_ARG_POINTER(aURI); nsAutoCString name = GetAboutModuleName(aURI); - LoadActivityStreamPrefs(); - 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") || name.EqualsLiteral("home")) { - if (sActivityStreamEnabled) { - *result = redir.flags | - nsIAboutModule::URI_MUST_LOAD_IN_CHILD | - nsIAboutModule::ENABLE_INDEXED_DB | - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT; - return NS_OK; - } - } - *result = redir.flags; return NS_OK; } } return NS_ERROR_ILLEGAL_VALUE; }
--- a/browser/components/about/AboutRedirector.h +++ b/browser/components/about/AboutRedirector.h @@ -19,19 +19,14 @@ public: AboutRedirector() {} static nsresult Create(nsISupports *aOuter, REFNSIID aIID, void **aResult); protected: virtual ~AboutRedirector() {} - -private: - static bool sActivityStreamEnabled; - - static void LoadActivityStreamPrefs(); }; } // namespace browser } // namespace mozilla #endif // AboutRedirector_h__
--- a/browser/components/about/test/unit/test_getURIFlags.js +++ b/browser/components/about/test/unit/test_getURIFlags.js @@ -1,31 +1,16 @@ ChromeUtils.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); }
--- a/browser/components/newtab/NewTabPrefsProvider.jsm +++ b/browser/components/newtab/NewTabPrefsProvider.jsm @@ -7,17 +7,16 @@ ChromeUtils.import("resource://gre/modul XPCOMUtils.defineLazyGetter(this, "EventEmitter", function() { const {EventEmitter} = ChromeUtils.import("resource://gre/modules/EventEmitter.jsm", {}); return EventEmitter; }); // Supported prefs and data type const gPrefsMap = new Map([ - ["browser.newtabpage.activity-stream.enabled", "bool"], ["browser.newtabpage.enabled", "bool"], ["browser.newtabpage.enhanced", "bool"], ["browser.newtabpage.introShown", "bool"], ["browser.newtabpage.updateIntroShown", "bool"], ["browser.newtabpage.pinned", "str"], ["browser.newtabpage.blocked", "str"], ["browser.search.hiddenOneOffs", "str"], ]);
--- a/browser/components/newtab/aboutNewTabService.js +++ b/browser/components/newtab/aboutNewTabService.js @@ -8,76 +8,73 @@ ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); ChromeUtils.import("resource://gre/modules/Services.jsm"); ChromeUtils.import("resource://gre/modules/AppConstants.jsm"); ChromeUtils.defineModuleGetter(this, "AboutNewTab", "resource:///modules/AboutNewTab.jsm"); -const LOCAL_NEWTAB_URL = "chrome://browser/content/newtab/newTab.xhtml"; +// Dummy references to the files that this service no longer allows loading. +// Bug 1409054 to remove "chrome://browser/content/abouthome/aboutHome.xhtml" +// Bug 1433133 to remove "chrome://browser/content/newtab/newTab.xhtml" + const TOPIC_APP_QUIT = "quit-application-granted"; const TOPIC_LOCALES_CHANGE = "intl:requested-locales-changed"; // Automated tests ensure packaged locales are in this list. Copied output of: // https://github.com/mozilla/activity-stream/blob/master/bin/render-activity-stream-html.js const ACTIVITY_STREAM_LOCALES = "en-US ach ar ast az be bg bn-BD bn-IN br bs ca cak cs cy da de dsb el en-GB eo es-AR es-CL es-ES es-MX et eu fa ff fi fr fy-NL ga-IE gd gl gn gu-IN he hi-IN hr hsb hu hy-AM ia id it ja ka kab kk km kn ko lij lo lt ltg lv mk ml mr ms my nb-NO ne-NP nl nn-NO pa-IN pl pt-BR pt-PT rm ro ru si sk sl sq sr sv-SE ta te th tl tr uk ur uz vi zh-CN zh-TW".split(" "); const ABOUT_URL = "about:newtab"; const IS_MAIN_PROCESS = Services.appinfo.processType === Services.appinfo.PROCESS_TYPE_DEFAULT; const IS_RELEASE_OR_BETA = AppConstants.RELEASE_OR_BETA; -// Pref that tells if activity stream is enabled -const PREF_ACTIVITY_STREAM_ENABLED = "browser.newtabpage.activity-stream.enabled"; const PREF_ACTIVITY_STREAM_PRERENDER_ENABLED = "browser.newtabpage.activity-stream.prerender"; const PREF_ACTIVITY_STREAM_DEBUG = "browser.newtabpage.activity-stream.debug"; function AboutNewTabService() { Services.obs.addObserver(this, TOPIC_APP_QUIT); Services.obs.addObserver(this, TOPIC_LOCALES_CHANGE); - Services.prefs.addObserver(PREF_ACTIVITY_STREAM_ENABLED, this); Services.prefs.addObserver(PREF_ACTIVITY_STREAM_PRERENDER_ENABLED, this); if (!IS_RELEASE_OR_BETA) { Services.prefs.addObserver(PREF_ACTIVITY_STREAM_DEBUG, this); } // More initialization happens here - this.toggleActivityStream(); + this.toggleActivityStream(true); this.initialized = true; if (IS_MAIN_PROCESS) { AboutNewTab.init(); } } /* * A service that allows for the overriding, at runtime, of the newtab page's url. - * Additionally, the service manages pref state between a activity stream, or the regular - * about:newtab page. * * There is tight coupling with browser/about/AboutRedirector.cpp. * * 1. Browser chrome access: * * When the user issues a command to open a new tab page, usually clicking a button * in the browser chrome or using shortcut keys, the browser chrome code invokes the * service to obtain the newtab URL. It then loads that URL in a new tab. * * When not overridden, the default URL emitted by the service is "about:newtab". * When overridden, it returns the overriden URL. * * 2. Redirector Access: * * When the URL loaded is about:newtab, the default behavior, or when entered in the - * URL bar, the redirector is hit. The service is then called to return either of - * two URLs, a chrome or the activity stream one, based on the - * browser.newtabpage.activity-stream.enabled pref. + * URL bar, the redirector is hit. The service is then called to return the + * appropriate activity stream url based on prefs and locales. * * NOTE: "about:newtab" will always result in a default newtab page, and never an overridden URL. * * Access patterns: * * The behavior is different when accessing the service via browser chrome or via redirector * largely to maintain compatibility with expectations of add-on developers. * @@ -102,21 +99,17 @@ AboutNewTabService.prototype = { ]), _xpcom_categories: [{ service: true }], observe(subject, topic, data) { switch (topic) { case "nsPref:changed": - if (data === PREF_ACTIVITY_STREAM_ENABLED) { - if (this.toggleActivityStream()) { - this.notifyChange(); - } - } else if (data === PREF_ACTIVITY_STREAM_PRERENDER_ENABLED) { + if (data === PREF_ACTIVITY_STREAM_PRERENDER_ENABLED) { this._activityStreamPrerender = Services.prefs.getBoolPref(PREF_ACTIVITY_STREAM_PRERENDER_ENABLED); this.notifyChange(); } else if (!IS_RELEASE_OR_BETA && data === PREF_ACTIVITY_STREAM_DEBUG) { this._activityStreamDebug = Services.prefs.getBoolPref(PREF_ACTIVITY_STREAM_DEBUG, false); this.updatePrerenderedPath(); this.notifyChange(); } break; @@ -133,31 +126,26 @@ AboutNewTabService.prototype = { } }, notifyChange() { Services.obs.notifyObservers(null, "newtab-url-changed", this._newTabURL); }, /** - * React to changes to the activity stream pref. - * - * If browser.newtabpage.activity-stream.enabled is true, this will change the default URL to the - * activity stream page URL. If browser.newtabpage.activity-stream.enabled is false, the default URL - * will be a local chrome URL. + * React to changes to the activity stream being enabled or not. * * This will only act if there is a change of state and if not overridden. * * @returns {Boolean} Returns if there has been a state change * * @param {Boolean} stateEnabled activity stream enabled state to set to * @param {Boolean} forceState force state change */ - toggleActivityStream(stateEnabled = Services.prefs.getBoolPref(PREF_ACTIVITY_STREAM_ENABLED), - forceState = false) { + toggleActivityStream(stateEnabled, forceState = false) { if (!forceState && (this.overridden || stateEnabled === this.activityStreamEnabled)) { // exit there is no change of state return false; } if (stateEnabled) { this._activityStreamEnabled = true; } else { @@ -185,37 +173,32 @@ AboutNewTabService.prototype = { // defaultLocale's strings aren't necessarily packaged, but en-US' are "en-US" )[0]}/`; }, /* * Returns the default URL. * - * This URL only depends on the browser.newtabpage.activity-stream.enabled pref. Overriding + * This URL depends on various activity stream prefs and locales. Overriding * the newtab page has no effect on the result of this function. - * - * @returns {String} the default newtab URL, activity-stream or regular depending on browser.newtabpage.activity-stream.enabled */ get defaultURL() { - if (this.activityStreamEnabled) { - // Generate the desired activity stream resource depending on state, e.g., - // resource://activity-stream/prerendered/ar/activity-stream.html - // resource://activity-stream/prerendered/en-US/activity-stream-prerendered.html - // resource://activity-stream/prerendered/static/activity-stream-debug.html - return [ - "resource://activity-stream/prerendered/", - this._activityStreamPath, - "activity-stream", - this._activityStreamPrerender ? "-prerendered" : "", - this._activityStreamDebug ? "-debug" : "", - ".html" - ].join(""); - } - return LOCAL_NEWTAB_URL; + // Generate the desired activity stream resource depending on state, e.g., + // resource://activity-stream/prerendered/ar/activity-stream.html + // resource://activity-stream/prerendered/en-US/activity-stream-prerendered.html + // resource://activity-stream/prerendered/static/activity-stream-debug.html + return [ + "resource://activity-stream/prerendered/", + this._activityStreamPath, + "activity-stream", + this._activityStreamPrerender ? "-prerendered" : "", + this._activityStreamDebug ? "-debug" : "", + ".html" + ].join(""); }, get newTabURL() { return this._newTabURL; }, set newTabURL(aNewTabURL) { aNewTabURL = aNewTabURL.trim(); @@ -247,27 +230,26 @@ AboutNewTabService.prototype = { get activityStreamDebug() { return this._activityStreamDebug; }, resetNewTabURL() { this._overridden = false; this._newTabURL = ABOUT_URL; - this.toggleActivityStream(undefined, true); + this.toggleActivityStream(true, true); this.notifyChange(); }, uninit() { if (!this.initialized) { return; } Services.obs.removeObserver(this, TOPIC_APP_QUIT); Services.obs.removeObserver(this, TOPIC_LOCALES_CHANGE); - Services.prefs.removeObserver(PREF_ACTIVITY_STREAM_ENABLED, this); Services.prefs.removeObserver(PREF_ACTIVITY_STREAM_PRERENDER_ENABLED, this); if (!IS_RELEASE_OR_BETA) { Services.prefs.removeObserver(PREF_ACTIVITY_STREAM_DEBUG, this); } this.initialized = false; } };
--- a/browser/components/newtab/tests/browser/browser_newtab_overrides.js +++ b/browser/components/newtab/tests/browser/browser_newtab_overrides.js @@ -1,22 +1,18 @@ "use strict"; ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); ChromeUtils.import("resource://gre/modules/Services.jsm"); -const PREF_NEWTAB_ACTIVITY_STREAM = "browser.newtabpage.activity-stream.enabled"; - -Services.prefs.setBoolPref(PREF_NEWTAB_ACTIVITY_STREAM, false); XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService", "@mozilla.org/browser/aboutnewtab-service;1", "nsIAboutNewTabService"); registerCleanupFunction(function() { - Services.prefs.clearUserPref(PREF_NEWTAB_ACTIVITY_STREAM); aboutNewTabService.resetNewTabURL(); }); /* * Tests that the default newtab page is always returned when one types "about:newtab" in the URL bar, * even when overridden. */ add_task(async function redirector_ignores_override() { @@ -43,19 +39,19 @@ add_task(async function redirector_ignor * Bug 1240169 - We expect the redirector to lead the user to "about:newtab", the default URL, * due to invoking AboutRedirector. A user interacting with the chrome otherwise would lead * to the overriding URLs. */ await BrowserTestUtils.withNewTab(tabOptions, async function(browser) { await ContentTask.spawn(browser, {}, async function() { Assert.equal(content.location.href, "about:newtab", "Got right URL"); Assert.equal(content.document.location.href, "about:newtab", "Got right URL"); - Assert.equal(content.document.nodePrincipal, + Assert.notEqual(content.document.nodePrincipal, Services.scriptSecurityManager.getSystemPrincipal(), - "nodePrincipal should match systemPrincipal"); + "activity stream principal should not match systemPrincipal"); }); }); // jshint ignore:line } }); /* * Tests loading an overridden newtab page by simulating opening a newtab page from chrome */
--- a/browser/components/newtab/tests/xpcshell/test_AboutNewTabService.js +++ b/browser/components/newtab/tests/xpcshell/test_AboutNewTabService.js @@ -14,51 +14,43 @@ XPCOMUtils.defineLazyServiceGetter(this, 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 DEFAULT_CHROME_URL = "chrome://browser/content/newtab/newTab.xhtml"; const DOWNLOADS_URL = "chrome://browser/content/downloads/contentAreaDownloadsView.xul"; -const ACTIVITY_STREAM_PREF = "browser.newtabpage.activity-stream.enabled"; 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(ACTIVITY_STREAM_PREF); Services.prefs.clearUserPref(ACTIVITY_STREAM_PRERENDER_PREF); Services.prefs.clearUserPref(ACTIVITY_STREAM_DEBUG_PREF); aboutNewTabService.resetNewTabURL(); } registerCleanupFunction(cleanup); add_task(async function test_as_and_prerender_initialized() { - Assert.equal(aboutNewTabService.activityStreamEnabled, Services.prefs.getBoolPref(ACTIVITY_STREAM_PREF), + Assert.ok(aboutNewTabService.activityStreamEnabled, ".activityStreamEnabled should be set to the correct initial value"); Assert.equal(aboutNewTabService.activityStreamPrerender, Services.prefs.getBoolPref(ACTIVITY_STREAM_PRERENDER_PREF), ".activityStreamPrerender should be set to the correct initial value"); // This pref isn't defined on release or beta, so we fall back to false Assert.equal(aboutNewTabService.activityStreamDebug, Services.prefs.getBoolPref(ACTIVITY_STREAM_DEBUG_PREF, false), ".activityStreamDebug should be set to the correct initial value"); }); /** * Test the overriding of the default URL */ add_task(async function test_override_activity_stream_disabled() { let notificationPromise; - Services.prefs.setBoolPref(ACTIVITY_STREAM_PREF, false); - - // tests default is the local newtab resource - Assert.equal(aboutNewTabService.defaultURL, DEFAULT_CHROME_URL, - `Default newtab URL should be ${DEFAULT_CHROME_URL}`); // override with some remote URL let url = "http://example.com/"; notificationPromise = nextChangeNotificationPromise(url); aboutNewTabService.newTabURL = url; await notificationPromise; Assert.ok(aboutNewTabService.overridden, "Newtab URL should be overridden"); Assert.ok(!aboutNewTabService.activityStreamEnabled, "Newtab activity stream should not be enabled"); @@ -84,24 +76,24 @@ add_task(async function test_override_ac 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.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"); - // change to local newtab page while activity stream is enabled - notificationPromise = nextChangeNotificationPromise(DEFAULT_CHROME_URL); - aboutNewTabService.newTabURL = DEFAULT_CHROME_URL; + // change to a chrome URL while activity stream is enabled + notificationPromise = nextChangeNotificationPromise(DOWNLOADS_URL); + aboutNewTabService.newTabURL = DOWNLOADS_URL; await notificationPromise; - Assert.equal(aboutNewTabService.newTabURL, DEFAULT_CHROME_URL, + Assert.equal(aboutNewTabService.newTabURL, DOWNLOADS_URL, "Newtab URL set to chrome url"); - Assert.equal(aboutNewTabService.defaultURL, DEFAULT_CHROME_URL, - "Newtab URL defaultURL set to the default chrome URL"); + Assert.equal(aboutNewTabService.defaultURL, ACTIVITY_STREAM_PRERENDER_URL, + "Newtab URL defaultURL still set to the default activity stream prerendered URL"); Assert.ok(aboutNewTabService.overridden, "Newtab URL should be overridden"); Assert.ok(!aboutNewTabService.activityStreamEnabled, "Activity Stream should not be enabled"); cleanup(); }); add_task(async function test_default_url() { await setupASPrerendered(); @@ -193,20 +185,16 @@ function setBoolPrefAndWaitForChange(pre }, "newtab-url-changed"); Services.prefs.setBoolPref(pref, value); }); } function setupASPrerendered() { - if (Services.prefs.getBoolPref(ACTIVITY_STREAM_PREF) && - Services.prefs.getBoolPref(ACTIVITY_STREAM_PRERENDER_PREF)) { + if (Services.prefs.getBoolPref(ACTIVITY_STREAM_PRERENDER_PREF)) { return Promise.resolve(); } - let notificationPromise; - // change newtab page to activity stream - notificationPromise = nextChangeNotificationPromise("about:newtab"); - Services.prefs.setBoolPref(ACTIVITY_STREAM_PREF, true); + let notificationPromise = nextChangeNotificationPromise("about:newtab"); Services.prefs.setBoolPref(ACTIVITY_STREAM_PRERENDER_PREF, true); return notificationPromise; }
--- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -362,23 +362,20 @@ BrowserGlue.prototype = { get browserErrorReporter() { Object.defineProperty(this, "browserErrorReporter", { value: new BrowserErrorReporter(), }); return this.browserErrorReporter; }, _sendMainPingCentrePing() { - const ACTIVITY_STREAM_ENABLED_PREF = "browser.newtabpage.activity-stream.enabled"; const ACTIVITY_STREAM_ID = "activity-stream"; - let asEnabled = Services.prefs.getBoolPref(ACTIVITY_STREAM_ENABLED_PREF, false); - const payload = { event: "AS_ENABLED", - value: asEnabled + value: true }; const options = {filter: ACTIVITY_STREAM_ID}; this.pingCentre.sendPing(payload, options); }, // nsIObserver implementation observe: function BG_observe(subject, topic, data) { switch (topic) {
--- a/browser/components/originattributes/test/browser/browser_firstPartyIsolation_about_newtab.js +++ b/browser/components/originattributes/test/browser/browser_firstPartyIsolation_about_newtab.js @@ -1,19 +1,13 @@ add_task(async function setup() { Services.prefs.setBoolPref("privacy.firstparty.isolate", true); - // activity-stream is only enabled in Nightly, and if activity-stream is not - // enabled, about:newtab is loaded without the flag - // nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT, so it will be loaded with - // System Principal. - Services.prefs.setBoolPref("browser.newtabpage.activity-stream.enabled", true); registerCleanupFunction(function() { Services.prefs.clearUserPref("privacy.firstparty.isolate"); - Services.prefs.clearUserPref("browser.newtabpage.activity-stream.enabled"); }); }); /** * Test about:newtab will have firstPartytDomain set when we enable the pref. * * We split about:newtab from browser_firstPartyIsolation_aboutPages.js because * about:newtab needs special care.
--- a/browser/components/sessionstore/test/browser_background_tab_crash.js +++ b/browser/components/sessionstore/test/browser_background_tab_crash.js @@ -222,22 +222,16 @@ add_task(async function test_background_ // Tests that crashed preloaded tabs are removed and no unexpected errors are // thrown. add_task(async function test_preload_crash() { if (!Services.prefs.getBoolPref("browser.newtab.preload")) { return; } - // Since new tab is only crashable for the activity-stream version, - // we need to flip the pref - await SpecialPowers.pushPrefEnv({ - set: [[ "browser.newtabpage.activity-stream.enabled", true ]] - }); - // Release any existing preloaded browser gBrowser.removePreloadedBrowser(); // Create a fresh preloaded browser gBrowser._createPreloadBrowser(); await BrowserTestUtils.crashBrowser(gBrowser._preloadedBrowser, false);
--- a/browser/components/tests/unit/test_browserGlue_pingcentre.js +++ b/browser/components/tests/unit/test_browserGlue_pingcentre.js @@ -1,25 +1,22 @@ ChromeUtils.import("resource:///modules/PingCentre.jsm"); const TOPIC_SHIELD_INIT_COMPLETE = "shield-init-complete"; -const ACTIVITY_STREAM_ENABLED_PREF = "browser.newtabpage.activity-stream.enabled"; const SEND_PING_MOCK = sinon.stub(PingCentre.prototype, "sendPing"); let gBrowserGlue = Cc["@mozilla.org/browser/browserglue;1"] .getService(Ci.nsIObserver); add_task(async function() { - let asEnabled = Services.prefs.getBoolPref(ACTIVITY_STREAM_ENABLED_PREF, false); - // Simulate ping centre sendPing() trigger. gBrowserGlue.observe(null, TOPIC_SHIELD_INIT_COMPLETE, null); const SEND_PING_CALL_ARGS = { event: "AS_ENABLED", - value: asEnabled + value: true }; const SEND_PING_FILTER = { filter: "activity-stream" }; Assert.ok(SEND_PING_MOCK.called, "gBrowserGlue.pingCentre.sendPing() is called"); Assert.ok(SEND_PING_MOCK.calledWithExactly(SEND_PING_CALL_ARGS, SEND_PING_FILTER), "sendPing() is called with the correct param"); });
--- a/browser/extensions/activity-stream/README.md +++ b/browser/extensions/activity-stream/README.md @@ -1,10 +1,9 @@ # activity-stream This system add-on replaces the new tab page in Firefox with a new design and -functionality as part of the Activity Stream project. It can be enabled (or disabled) -via the browser.newtabpage.activity-stream.enabled pref. +functionality as part of the Activity Stream project. The files in this directory, including vendor dependencies, are imported from the system-addon directory in https://github.com/mozilla/activity-stream. Read [docs/v2-system-addon](https://github.com/mozilla/activity-stream/tree/master/docs/v2-system-addon/1.GETTING_STARTED.md) for more detail.
--- a/browser/extensions/activity-stream/bootstrap.js +++ b/browser/extensions/activity-stream/bootstrap.js @@ -4,17 +4,16 @@ "use strict"; ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.importGlobalProperties(["fetch"]); ChromeUtils.defineModuleGetter(this, "Services", "resource://gre/modules/Services.jsm"); -const ACTIVITY_STREAM_ENABLED_PREF = "browser.newtabpage.activity-stream.enabled"; const BROWSER_READY_NOTIFICATION = "sessionstore-windows-restored"; const PREF_CHANGED_TOPIC = "nsPref:changed"; const REASON_SHUTDOWN_ON_PREF_CHANGE = "PREF_OFF"; const REASON_STARTUP_ON_PREF_CHANGE = "PREF_ON"; const RESOURCE_BASE = "resource://activity-stream"; const ACTIVITY_STREAM_OPTIONS = {newTabURL: "about:newtab"}; @@ -42,18 +41,17 @@ XPCOMUtils.defineLazyModuleGetter(this, } }); } }); }); /** * init - Initializes an instance of ActivityStream. This could be called by - * the startup() function exposed by bootstrap.js, or it could be called - * when ACTIVITY_STREAM_ENABLED_PREF is changed from false to true. + * the startup() function exposed by bootstrap.js. * * @param {string} reason - Reason for initialization. Could be install, upgrade, or PREF_ON */ function init(reason) { // Don't re-initialize if (activityStream && activityStream.initialized) { return; } @@ -63,42 +61,29 @@ function init(reason) { activityStream.init(reason); } catch (e) { Cu.reportError(e); } } /** * uninit - Uninitializes the activityStream instance, if it exsits.This could be - * called by the shutdown() function exposed by bootstrap.js, or it could - * be called when ACTIVITY_STREAM_ENABLED_PREF is changed from true to false. + * called by the shutdown() function exposed by bootstrap.js. * * @param {type} reason Reason for uninitialization. Could be uninstall, upgrade, or PREF_OFF */ function uninit(reason) { // Make sure to only uninit once in case both pref change and shutdown happen if (activityStream) { activityStream.uninit(reason); activityStream = null; } } /** - * onPrefChanged - handler for changes to ACTIVITY_STREAM_ENABLED_PREF - * - */ -function onPrefChanged() { - if (Services.prefs.getBoolPref(ACTIVITY_STREAM_ENABLED_PREF, false)) { - init(REASON_STARTUP_ON_PREF_CHANGE); - } else { - uninit(REASON_SHUTDOWN_ON_PREF_CHANGE); - } -} - -/** * Check if an old pref has a custom value to migrate. Clears the pref so that * it's the default after migrating (to avoid future need to migrate). * * @param oldPrefName {string} Pref to check and migrate * @param cbIfNotDefault {function} Callback that gets the current pref value */ function migratePref(oldPrefName, cbIfNotDefault) { // Nothing to do if the user doesn't have a custom value @@ -125,24 +110,17 @@ function migratePref(oldPrefName, cbIfNo Services.prefs.clearUserPref(oldPrefName); } /** * onBrowserReady - Continues startup of the add-on after browser is ready. */ function onBrowserReady() { waitingForBrowserReady = false; - - // Listen for changes to the pref that enables Activity Stream - Services.prefs.addObserver(ACTIVITY_STREAM_ENABLED_PREF, observe); // eslint-disable-line no-use-before-define - - // Only initialize if the pref is true - if (Services.prefs.getBoolPref(ACTIVITY_STREAM_ENABLED_PREF, false)) { - init(startupReason); - } + init(startupReason); // Do a one time migration of Tiles about:newtab prefs that have been modified migratePref("browser.newtabpage.rows", rows => { // Just disable top sites if rows are not desired if (rows <= 0) { Services.prefs.setBoolPref("browser.newtabpage.activity-stream.showTopSites", false); } else { Services.prefs.setIntPref("browser.newtabpage.activity-stream.topSitesRows", rows); @@ -160,21 +138,16 @@ function onBrowserReady() { */ function observe(subject, topic, data) { switch (topic) { case BROWSER_READY_NOTIFICATION: Services.obs.removeObserver(observe, BROWSER_READY_NOTIFICATION); // Avoid running synchronously during this event that's used for timing Services.tm.dispatchToMainThread(() => onBrowserReady()); break; - case PREF_CHANGED_TOPIC: - if (data === ACTIVITY_STREAM_ENABLED_PREF) { - onPrefChanged(); - } - break; } } // The functions below are required by bootstrap.js this.install = function install(data, reason) {}; this.startup = function startup(data, reason) { @@ -196,19 +169,16 @@ this.shutdown = function shutdown(data, // Uninitialize Activity Stream startupData = null; startupReason = null; uninit(reason); // Stop waiting for browser to be ready if (waitingForBrowserReady) { Services.obs.removeObserver(observe, BROWSER_READY_NOTIFICATION); - } else { - // Stop listening to the pref that enables Activity Stream - Services.prefs.removeObserver(ACTIVITY_STREAM_ENABLED_PREF, observe); } // Unload any add-on modules that might might have been imported modulesToUnload.forEach(Cu.unload); }; this.uninstall = function uninstall(data, reason) { if (activityStream) {
--- a/browser/extensions/activity-stream/test/functional/mochitest/browser_as_load_location.js +++ b/browser/extensions/activity-stream/test/functional/mochitest/browser_as_load_location.js @@ -31,23 +31,8 @@ async function checkActivityStreamLoads( // Run a first time not from a preloaded browser add_task(async function checkActivityStreamNotPreloadedLoad() { gBrowser.removePreloadedBrowser(); await checkActivityStreamLoads(); }); // Run a second time from a preloaded browser add_task(checkActivityStreamLoads); - -// Test with activity stream off -async function checkNotActivityStreamLoads() { - await SpecialPowers.pushPrefEnv({set: [["browser.newtabpage.activity-stream.enabled", false]]}); - await checkNewtabLoads("body:not(.activity-stream)", "Got <body> Element not for activity-stream"); -} - -// Run a first time not from a preloaded browser -add_task(async function checkNotActivityStreamNotPreloadedLoad() { - gBrowser.removePreloadedBrowser(); - await checkNotActivityStreamLoads(); -}); - -// Run a second time from a preloaded browser -add_task(checkNotActivityStreamLoads);
--- a/browser/extensions/activity-stream/test/functional/mochitest/head.js +++ b/browser/extensions/activity-stream/test/functional/mochitest/head.js @@ -5,22 +5,16 @@ ChromeUtils.defineModuleGetter(this, "Pl function popPrefs() { return SpecialPowers.popPrefEnv(); } function pushPrefs(...prefs) { return SpecialPowers.pushPrefEnv({set: prefs}); } -// Activity Stream tests expect it to be enabled, and make sure to clear out any -// preloaded browsers that might have about:newtab that we don't want to test -const ACTIVITY_STREAM_PREF = "browser.newtabpage.activity-stream.enabled"; -pushPrefs([ACTIVITY_STREAM_PREF, true]); -gBrowser.removePreloadedBrowser(); - async function clearHistoryAndBookmarks() { // eslint-disable-line no-unused-vars await PlacesUtils.bookmarks.eraseEverything(); await PlacesUtils.history.clear(); } /** * Helper to wait for potentially preloaded browsers to "load" where a preloaded * page has already loaded and won't trigger "load", and a "load"ed page might
--- a/browser/extensions/onboarding/test/browser/browser_onboarding_accessibility.js +++ b/browser/extensions/onboarding/test/browser/browser_onboarding_accessibility.js @@ -25,35 +25,16 @@ add_task(async function test_onboarding_ "Onboarding button semantically controls an overlay dialog"); is(button.firstChild.getAttribute("role"), "presentation", "Onboarding button icon should have presentation only semantics"); }); await BrowserTestUtils.removeTab(tab); }); -add_task(async function test_onboarding_overlay_button_no_activity_steam() { - /* https://bugzilla.mozilla.org/show_bug.cgi?id=1393564 */ - resetOnboardingDefaultState(); - Preferences.set("browser.newtabpage.activity-stream.enabled", false); - - info("Wait for onboarding overlay loaded"); - let tab = await openTab(ABOUT_NEWTAB_URL); - let browser = tab.linkedBrowser; - await promiseOnboardingOverlayLoaded(browser); - - info("Click on overlay button and ensure dialog opens"); - await BrowserTestUtils.synthesizeMouseAtCenter("#onboarding-overlay-button", - {}, browser); - await promiseOnboardingOverlayOpened(browser); - - Preferences.reset("browser.newtabpage.activity-stream.enabled"); - await BrowserTestUtils.removeTab(tab); -}); - add_task(async function test_onboarding_notification_bar() { resetOnboardingDefaultState(); skipMuteNotificationOnFirstSession(); let tab = await openTab(ABOUT_NEWTAB_URL); await promiseOnboardingOverlayLoaded(tab.linkedBrowser); await promiseTourNotificationOpened(tab.linkedBrowser);
--- a/dom/base/test/browser_messagemanager_loadprocessscript.js +++ b/dom/base/test/browser_messagemanager_loadprocessscript.js @@ -2,23 +2,18 @@ var ppmm = Cc["@mozilla.org/parentproces .getService(Ci.nsIMessageBroadcaster); ppmm.QueryInterface(Ci.nsIProcessScriptLoader); const BASE_NUMBER_OF_PROCESSES = 3; function checkBaseProcessCount(description) { const {childCount} = ppmm; // With preloaded activity-stream, process count is a bit undeterministic, so // allow for some variation - if (Services.prefs.getBoolPref("browser.newtabpage.activity-stream.enabled")) { - const extraCount = BASE_NUMBER_OF_PROCESSES + 1; - ok(childCount === BASE_NUMBER_OF_PROCESSES || childCount === extraCount, `${description} (${BASE_NUMBER_OF_PROCESSES} or ${extraCount})`); - } - else { - is(childCount, BASE_NUMBER_OF_PROCESSES, `${description} (${BASE_NUMBER_OF_PROCESSES})`); - } + const extraCount = BASE_NUMBER_OF_PROCESSES + 1; + ok(childCount === BASE_NUMBER_OF_PROCESSES || childCount === extraCount, `${description} (${BASE_NUMBER_OF_PROCESSES} or ${extraCount})`); } function processScript() { let cpmm = Components.classes["@mozilla.org/childprocessmessagemanager;1"] .getService(Components.interfaces.nsISyncMessageSender); if (cpmm !== this) { dump("Test failed: wrong global object\n"); return;