Bug 1329262 - Enable compact themes in mozscreenshots;r=MattN
MozReview-Commit-ID: A574iIkQgkW
--- a/browser/tools/mozscreenshots/head.js
+++ b/browser/tools/mozscreenshots/head.js
@@ -9,17 +9,19 @@
const {AddonWatcher} = Cu.import("resource://gre/modules/AddonWatcher.jsm", {});
const chromeRegistry = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIChromeRegistry);
const env = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment);
const EXTENSION_DIR = "chrome://mochitests/content/extensions/mozscreenshots/browser/";
let TestRunner;
function* setup() {
- requestLongerTimeout(10);
+ // This timeout doesn't actually end the job even if it is hit - the buildbot timeout will
+ // handle things for us if the test actually hangs.
+ requestLongerTimeout(100);
info("installing extension temporarily");
let chromeURL = Services.io.newURI(EXTENSION_DIR);
let dir = chromeRegistry.convertChromeURL(chromeURL).QueryInterface(Ci.nsIFileURL).file;
yield AddonManager.installTemporaryAddon(dir);
info("Checking for mozscreenshots extension");
return new Promise((resolve) => {
deleted file mode 100644
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/DevEdition.jsm
+++ /dev/null
@@ -1,42 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["DevEdition"];
-
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-const THEME_ID = "firefox-devedition@mozilla.org";
-
-Cu.import("resource://gre/modules/LightweightThemeManager.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-
-this.DevEdition = {
- init(libDir) {},
-
- configurations: {
- devEditionLight: {
- applyConfig: Task.async(() => {
- Services.prefs.setCharPref("devtools.theme", "light");
- LightweightThemeManager.currentTheme = LightweightThemeManager.getUsedTheme(THEME_ID);
- Services.prefs.setBoolPref("browser.devedition.theme.showCustomizeButton", true);
- }),
- },
- devEditionDark: {
- applyConfig: Task.async(() => {
- Services.prefs.setCharPref("devtools.theme", "dark");
- LightweightThemeManager.currentTheme = LightweightThemeManager.getUsedTheme(THEME_ID);
- Services.prefs.setBoolPref("browser.devedition.theme.showCustomizeButton", true);
- }),
- },
- devEditionOff: {
- applyConfig: Task.async(() => {
- Services.prefs.clearUserPref("devtools.theme");
- LightweightThemeManager.currentTheme = null;
- Services.prefs.clearUserPref("browser.devedition.theme.showCustomizeButton");
- }),
- },
- },
-};
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/LightweightThemes.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/LightweightThemes.jsm
@@ -71,16 +71,27 @@ this.LightweightThemes = {
resolve("lightLWT");
}, 500);
});
},
verifyConfig: verifyConfigHelper,
},
+ compactLight: {
+ applyConfig: Task.async(() => {
+ LightweightThemeManager.currentTheme = LightweightThemeManager.getUsedTheme("firefox-compact-light@mozilla.org");
+ }),
+ },
+
+ compactDark: {
+ applyConfig: Task.async(() => {
+ LightweightThemeManager.currentTheme = LightweightThemeManager.getUsedTheme("firefox-compact-dark@mozilla.org");
+ }),
+ },
},
};
function verifyConfigHelper() {
return new Promise((resolve, reject) => {
let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
if (browserWindow.document.documentElement.hasAttribute("lwtheme")) {
--- a/browser/tools/mozscreenshots/primaryUI/browser_primaryUI.js
+++ b/browser/tools/mozscreenshots/primaryUI/browser_primaryUI.js
@@ -6,13 +6,11 @@
"use strict";
add_task(function* capture() {
if (!shouldCapture()) {
return;
}
- requestLongerTimeout(20);
-
let sets = ["TabsInTitlebar", "Tabs", "WindowSize", "Toolbars", "LightweightThemes"];
yield TestRunner.start(sets, "primaryUI");
});