Bug 1169993 - Remove duplicated setTheme methods from performance and webaudio tests. r=bgrins

This commit is contained in:
Sami Jaktholm 2015-06-03 19:36:35 +03:00
parent 0cb894dbb3
commit f257f9257d
2 changed files with 4 additions and 32 deletions

View File

@ -6,6 +6,8 @@
* theme on load, and rerenders when changed.
*/
const { setTheme } = devtools.require("devtools/shared/theme");
const LIGHT_BG = "#fcfcfc";
const DARK_BG = "#14171a";
@ -70,19 +72,3 @@ function* spawnTest() {
yield teardown(panel);
finish();
}
/**
* Mimics selecting the theme selector in the toolbox;
* sets the preference and emits an event on gDevTools to trigger
* the themeing.
*/
function setTheme (newTheme) {
let oldTheme = Services.prefs.getCharPref("devtools.theme");
info("Setting `devtools.theme` to \"" + newTheme + "\"");
Services.prefs.setCharPref("devtools.theme", newTheme);
gDevTools.emit("pref-changed", {
pref: "devtools.theme",
newValue: newTheme,
oldValue: oldTheme
});
}

View File

@ -5,6 +5,8 @@
* Tests that the SVG marker styling is updated when devtools theme changes.
*/
const { setTheme } = devtools.require("devtools/shared/theme");
add_task(function*() {
let { target, panel } = yield initWebAudioEditor(SIMPLE_CONTEXT_URL);
let { panelWin } = panel;
@ -57,19 +59,3 @@ add_task(function*() {
function getFill (el) {
return el.getAttribute("style").match(/(#.*)$/)[1];
}
/**
* Mimics selecting the theme selector in the toolbox;
* sets the preference and emits an event on gDevTools to trigger
* the themeing.
*/
function setTheme (newTheme) {
let oldTheme = Services.prefs.getCharPref("devtools.theme");
info("Setting `devtools.theme` to \"" + newTheme + "\"");
Services.prefs.setCharPref("devtools.theme", newTheme);
gDevTools.emit("pref-changed", {
pref: "devtools.theme",
newValue: newTheme,
oldValue: oldTheme
});
}