2009-02-12 16:35:03 +03:00
|
|
|
// Load in the test harness
|
|
|
|
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
|
|
|
|
.getService(Components.interfaces.mozIJSSubScriptLoader);
|
2010-10-01 04:10:19 +04:00
|
|
|
|
|
|
|
var rootDir = getRootDirectory(window.location.href);
|
|
|
|
scriptLoader.loadSubScript(rootDir + "harness.js", this);
|
2009-02-12 16:35:03 +03:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// Test whether an InstallTrigger.enabled is working
|
|
|
|
function test() {
|
|
|
|
waitForExplicitFinish();
|
|
|
|
|
2010-04-03 11:36:55 +04:00
|
|
|
Services.prefs.setBoolPref("xpinstall.enabled", false);
|
2009-02-12 16:35:03 +03:00
|
|
|
|
|
|
|
gBrowser.selectedTab = gBrowser.addTab();
|
|
|
|
gBrowser.selectedBrowser.addEventListener("load", function() {
|
2009-04-16 18:50:21 +04:00
|
|
|
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
2009-02-12 16:35:03 +03:00
|
|
|
// Allow the in-page load handler to run first
|
|
|
|
executeSoon(page_loaded);
|
|
|
|
}, true);
|
|
|
|
gBrowser.loadURI(TESTROOT + "enabled.html");
|
|
|
|
}
|
|
|
|
|
|
|
|
function page_loaded() {
|
2010-04-03 11:36:55 +04:00
|
|
|
Services.prefs.clearUserPref("xpinstall.enabled");
|
2009-02-12 16:35:03 +03:00
|
|
|
|
|
|
|
var doc = gBrowser.contentDocument;
|
|
|
|
is(doc.getElementById("enabled").textContent, "false", "installTrigger should have not been enabled");
|
|
|
|
gBrowser.removeCurrentTab();
|
|
|
|
finish();
|
|
|
|
}
|