B2G/gecko/toolkit/mozapps/extensions/test/xpinstall/browser_enabled3.js
// Test whether an InstallTrigger.install call fails when xpinstall is disabled
Test whether an InstallTrigger.install call fails when xpinstall is disabled
Test whether an InstallTrigger . install call fails when xpinstall is disabled
function test() {
  Harness.installDisabledCallback = install_disabled;
  Harness.installBlockedCallback = allow_blocked;
  Harness.installConfirmCallback = confirm_install;
  Harness.setup();
  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);
    executeSoon(page_loaded);
  }, true);
  gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
}
function test ( ) { Harness . installDisabledCallback = install_disabled ; Harness . installBlockedCallback = allow_blocked ; Harness . installConfirmCallback = confirm_install ; Harness . setup ( ) ; 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 ) ; executeSoon ( page_loaded ) ; } , true ) ; gBrowser . loadURI ( TESTROOT + "installtrigger.html?" + triggers ) ; }
Test whether an InstallTrigger.install call fails when xpinstall is disabled
Test whether an InstallTrigger . install call fails when xpinstall is disabled
// Allow the in-page load handler to run first