toolkit/mozapps/extensions/test/xpinstall/browser_bug611242.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 // ----------------------------------------------------------------------------
     2 // Test whether setting a new property in InstallTrigger then persists to other
     3 // page loads
     4 function loadURI(aUri, aCallback) {
     5   gBrowser.selectedBrowser.addEventListener("load", function() {
     6     if (gBrowser.selectedBrowser.currentURI.spec != aUri)
     7       return;
     9     gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
    11     aCallback();
    12   }, true);
    14   gBrowser.loadURI(aUri);
    15 }
    17 function test() {
    18   waitForExplicitFinish();
    20   gBrowser.selectedTab = gBrowser.addTab();
    22   loadURI(TESTROOT + "enabled.html", function() {
    23     window.content.wrappedJSObject.InstallTrigger.enabled.k = function() { };
    25     loadURI(TESTROOT2 + "enabled.html", function() {
    26       is(window.content.wrappedJSObject.InstallTrigger.enabled.k, undefined, "Property should not be defined");
    28       gBrowser.removeTab(gBrowser.selectedTab);
    30       finish();
    31     });
    32   });
    33 }
    34 // ----------------------------------------------------------------------------

mercurial