2011-10-26 02:52:17 -07:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
|
|
|
|
const TEST_BASE = "chrome://mochitests/content/browser/browser/devtools/styleeditor/test/";
|
|
|
|
const TEST_BASE_HTTP = "http://example.com/browser/browser/devtools/styleeditor/test/";
|
|
|
|
const TEST_BASE_HTTPS = "https://example.com/browser/browser/devtools/styleeditor/test/";
|
|
|
|
|
|
|
|
let gChromeWindow; //StyleEditorChrome window
|
|
|
|
|
2012-08-14 07:51:48 -07:00
|
|
|
// Import the GCLI test helper
|
|
|
|
let testDir = gTestPath.substr(0, gTestPath.lastIndexOf("/"));
|
|
|
|
Services.scriptloader.loadSubScript(testDir + "/helper.js", this);
|
|
|
|
|
2011-10-26 02:52:17 -07:00
|
|
|
function cleanup()
|
|
|
|
{
|
|
|
|
if (gChromeWindow) {
|
|
|
|
gChromeWindow.close();
|
|
|
|
gChromeWindow = null;
|
|
|
|
}
|
|
|
|
while (gBrowser.tabs.length > 1) {
|
|
|
|
gBrowser.removeCurrentTab();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-02-10 05:39:47 -08:00
|
|
|
function launchStyleEditorChrome(aCallback, aSheet, aLine, aCol)
|
2011-10-26 02:52:17 -07:00
|
|
|
{
|
2012-02-10 05:39:47 -08:00
|
|
|
gChromeWindow = StyleEditor.openChrome(aSheet, aLine, aCol);
|
2011-10-26 02:52:17 -07:00
|
|
|
if (gChromeWindow.document.readyState != "complete") {
|
|
|
|
gChromeWindow.addEventListener("load", function onChromeLoad() {
|
|
|
|
gChromeWindow.removeEventListener("load", onChromeLoad, true);
|
|
|
|
gChromeWindow.styleEditorChrome._alwaysDisableAnimations = true;
|
|
|
|
aCallback(gChromeWindow.styleEditorChrome);
|
|
|
|
}, true);
|
|
|
|
} else {
|
|
|
|
gChromeWindow.styleEditorChrome._alwaysDisableAnimations = true;
|
|
|
|
aCallback(gChromeWindow.styleEditorChrome);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-02-10 05:39:47 -08:00
|
|
|
function addTabAndLaunchStyleEditorChromeWhenLoaded(aCallback, aSheet, aLine, aCol)
|
2011-10-26 02:52:17 -07:00
|
|
|
{
|
|
|
|
gBrowser.selectedTab = gBrowser.addTab();
|
|
|
|
gBrowser.selectedBrowser.addEventListener("load", function onLoad() {
|
|
|
|
gBrowser.selectedBrowser.removeEventListener("load", onLoad, true);
|
2012-02-10 05:39:47 -08:00
|
|
|
launchStyleEditorChrome(aCallback, aSheet, aLine, aCol);
|
2011-10-26 02:52:17 -07:00
|
|
|
}, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
registerCleanupFunction(cleanup);
|