2009-02-12 05:35:03 -08:00
|
|
|
// Load in the test harness
|
|
|
|
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
|
|
|
|
.getService(Components.interfaces.mozIJSSubScriptLoader);
|
2010-09-30 17:10:19 -07:00
|
|
|
|
|
|
|
var rootDir = getRootDirectory(window.location.href);
|
|
|
|
scriptLoader.loadSubScript(rootDir + "harness.js", this);
|
2009-02-12 05:35:03 -08:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// Test whether an InstallTrigger.enabled is working
|
|
|
|
function test() {
|
|
|
|
waitForExplicitFinish();
|
|
|
|
|
|
|
|
gBrowser.selectedTab = gBrowser.addTab();
|
|
|
|
gBrowser.selectedBrowser.addEventListener("load", function() {
|
2009-04-16 07:50:21 -07:00
|
|
|
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
2009-02-12 05:35:03 -08:00
|
|
|
// 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();
|
|
|
|
}
|