1 // Load in the test harness
2 var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
3 .getService(Components.interfaces.mozIJSSubScriptLoader);
5 var rootDir = getRootDirectory(window.location.href);
6 scriptLoader.loadSubScript(rootDir + "harness.js", this);
8 // ----------------------------------------------------------------------------
9 // Test whether an InstallTrigger.enabled is working
11 waitForExplicitFinish();
13 Services.prefs.setBoolPref("xpinstall.enabled", false);
15 gBrowser.selectedTab = gBrowser.addTab();
16 gBrowser.selectedBrowser.addEventListener("load", function() {
17 gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
18 // Allow the in-page load handler to run first
19 executeSoon(page_loaded);
21 gBrowser.loadURI(TESTROOT + "enabled.html");
24 function page_loaded() {
25 Services.prefs.clearUserPref("xpinstall.enabled");
27 var doc = gBrowser.contentDocument;
28 is(doc.getElementById("enabled").textContent, "false", "installTrigger should have not been enabled");
29 gBrowser.removeCurrentTab();