Bug 1428108 - Set browser.newtabpage.activity-stream.debug by default in local builds. r?Mardak
MozReview-Commit-ID: Gwd2fA6xfoX
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1284,17 +1284,21 @@ pref("browser.newtabpage.rows", 3);
pref("browser.newtabpage.columns", 5);
// directory tiles download URL
pref("browser.newtabpage.directory.source", "https://tiles.services.mozilla.com/v3/links/fetch/%LOCALE%/%CHANNEL%");
// Activity Stream prefs that control to which page to redirect
pref("browser.newtabpage.activity-stream.prerender", true);
#ifndef RELEASE_OR_BETA
+#ifdef MOZILLA_OFFICIAL
pref("browser.newtabpage.activity-stream.debug", false);
+#else
+pref("browser.newtabpage.activity-stream.debug", true);
+#endif
#endif
pref("browser.library.activity-stream.enabled", true);
// Enable the DOM fullscreen API.
pref("full-screen-api.enabled", true);
// Startup Crash Tracking
--- a/browser/components/newtab/tests/xpcshell/test_AboutNewTabService.js
+++ b/browser/components/newtab/tests/xpcshell/test_AboutNewTabService.js
@@ -7,17 +7,17 @@
ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("resource://gre/modules/Preferences.jsm");
ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
"@mozilla.org/browser/aboutnewtab-service;1",
"nsIAboutNewTabService");
-const IS_RELEASE_OR_BETA = AppConstants.RELEASE_OR_BETA;
+const {IS_RELEASE_OR_BETA, MOZILLA_OFFICIAL} = AppConstants;
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 ACTIVITY_STREAM_PRERENDER_PREF = "browser.newtabpage.activity-stream.prerender";
@@ -129,16 +129,26 @@ add_task(async function test_default_url
cleanup();
});
add_task(function test_locale() {
Assert.equal(aboutNewTabService.activityStreamLocale, "en-US",
"The locale for testing should be en-US");
});
+add_task(async function test_debug_mode() {
+ if (!IS_RELEASE_OR_BETA && !MOZILLA_OFFICIAL) { // Check if local build
+ Assert.equal(aboutNewTabService.activityStreamDebug, true,
+ "Debug mode is set for builds that are not official");
+ } else {
+ Assert.equal(aboutNewTabService.activityStreamDebug, false,
+ "Debug mode is not set for any other builds");
+ }
+});
+
/**
* Tests reponse to updates to prefs
*/
add_task(async function test_updates() {
/*
* Simulates a "cold-boot" situation, with some pref already set before testing a series
* of changes.
*/
@@ -190,16 +200,19 @@ function setBoolPrefAndWaitForChange(pre
}, "newtab-url-changed");
Services.prefs.setBoolPref(pref, value);
});
}
function setupASPrerendered() {
+ // Don't run in debug mode regardless of build type
+ Services.prefs.setBoolPref(ACTIVITY_STREAM_DEBUG_PREF, false);
+
if (Services.prefs.getBoolPref(ACTIVITY_STREAM_PRERENDER_PREF)) {
return Promise.resolve();
}
let notificationPromise = nextChangeNotificationPromise("about:newtab");
Services.prefs.setBoolPref(ACTIVITY_STREAM_PRERENDER_PREF, true);
return notificationPromise;
}