mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-08 20:47:44 +00:00
28 lines
1.0 KiB
JavaScript
28 lines
1.0 KiB
JavaScript
// Load in the test harness
|
|
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
|
|
.getService(Components.interfaces.mozIJSSubScriptLoader);
|
|
|
|
var rootDir = getRootDirectory(window.location.href);
|
|
scriptLoader.loadSubScript(rootDir + "harness.js", this);
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// Test whether an InstallTrigger.enabled is working
|
|
function test() {
|
|
waitForExplicitFinish();
|
|
|
|
gBrowser.selectedTab = gBrowser.addTab();
|
|
gBrowser.selectedBrowser.addEventListener("load", function() {
|
|
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
|
// Allow the in-page load handler to run first
|
|
executeSoon(page_loaded);
|
|
}, true);
|
|
gBrowser.loadURI(TESTROOT + "enabled.html");
|
|
}
|
|
|
|
function page_loaded() {
|
|
var doc = gBrowser.contentDocument;
|
|
is(doc.getElementById("enabled").textContent, "true", "installTrigger should have been enabled");
|
|
gBrowser.removeCurrentTab();
|
|
finish();
|
|
}
|