Backed out changeset b88172246b66 due to Win32 debug failures.
[mozilla-central.git] / xpinstall / tests / browser_enabled2.js
blob81c5e1c13d11bd0a1e51b618633d60811f567c8b
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
10 function test() {
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);
20   }, true);
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();
30   finish();