mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
29 lines
1.0 KiB
JavaScript
29 lines
1.0 KiB
JavaScript
|
// ----------------------------------------------------------------------------
|
||
|
// Test whether an InstallTrigger.install call fails when xpinstall is disabled
|
||
|
function test() {
|
||
|
waitForExplicitFinish();
|
||
|
|
||
|
Services.prefs.setBoolPref("xpinstall.enabled", false);
|
||
|
|
||
|
var triggers = encodeURIComponent(JSON.stringify({
|
||
|
"Unsigned XPI": TESTROOT + "unsigned.xpi"
|
||
|
}));
|
||
|
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 + "installtrigger.html?" + triggers);
|
||
|
}
|
||
|
|
||
|
function page_loaded() {
|
||
|
Services.prefs.clearUserPref("xpinstall.enabled");
|
||
|
|
||
|
var doc = gBrowser.contentDocument;
|
||
|
is(doc.getElementById("return").textContent, "false", "installTrigger should have not been enabled");
|
||
|
gBrowser.removeCurrentTab();
|
||
|
finish();
|
||
|
}
|
||
|
// ----------------------------------------------------------------------------
|