Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | // ---------------------------------------------------------------------------- |
michael@0 | 2 | // Test whether setting a new property in InstallTrigger then persists to other |
michael@0 | 3 | // page loads |
michael@0 | 4 | function loadURI(aUri, aCallback) { |
michael@0 | 5 | gBrowser.selectedBrowser.addEventListener("load", function() { |
michael@0 | 6 | if (gBrowser.selectedBrowser.currentURI.spec != aUri) |
michael@0 | 7 | return; |
michael@0 | 8 | |
michael@0 | 9 | gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true); |
michael@0 | 10 | |
michael@0 | 11 | aCallback(); |
michael@0 | 12 | }, true); |
michael@0 | 13 | |
michael@0 | 14 | gBrowser.loadURI(aUri); |
michael@0 | 15 | } |
michael@0 | 16 | |
michael@0 | 17 | function test() { |
michael@0 | 18 | waitForExplicitFinish(); |
michael@0 | 19 | |
michael@0 | 20 | gBrowser.selectedTab = gBrowser.addTab(); |
michael@0 | 21 | |
michael@0 | 22 | loadURI(TESTROOT + "enabled.html", function() { |
michael@0 | 23 | window.content.wrappedJSObject.InstallTrigger.enabled.k = function() { }; |
michael@0 | 24 | |
michael@0 | 25 | loadURI(TESTROOT2 + "enabled.html", function() { |
michael@0 | 26 | is(window.content.wrappedJSObject.InstallTrigger.enabled.k, undefined, "Property should not be defined"); |
michael@0 | 27 | |
michael@0 | 28 | gBrowser.removeTab(gBrowser.selectedTab); |
michael@0 | 29 | |
michael@0 | 30 | finish(); |
michael@0 | 31 | }); |
michael@0 | 32 | }); |
michael@0 | 33 | } |
michael@0 | 34 | // ---------------------------------------------------------------------------- |