docshell/test/browser/browser_bug388121-1.js

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

michael@0 1 function test() {
michael@0 2 waitForExplicitFinish();
michael@0 3
michael@0 4 var newTab;
michael@0 5 var newBrowser;
michael@0 6 const secMan = Cc["@mozilla.org/scriptsecuritymanager;1"].getService(Ci.nsIScriptSecurityManager);
michael@0 7
michael@0 8 function testLoad(event) {
michael@0 9 newBrowser.removeEventListener("load", testLoad, true);
michael@0 10 is (event.target, newBrowser.contentDocument, "Unexpected target");
michael@0 11 var prin = newBrowser.contentDocument.nodePrincipal;
michael@0 12 isnot(prin, null, "Loaded principal must not be null");
michael@0 13 isnot(prin, undefined, "Loaded principal must not be undefined");
michael@0 14 is(secMan.isSystemPrincipal(prin), false,
michael@0 15 "Loaded principal must not be system");
michael@0 16 gBrowser.removeTab(newTab);
michael@0 17
michael@0 18 finish();
michael@0 19 }
michael@0 20
michael@0 21 newTab = gBrowser.addTab();
michael@0 22 newBrowser = gBrowser.getBrowserForTab(newTab);
michael@0 23 newBrowser.contentWindow.location.href = "about:blank"
michael@0 24 newBrowser.addEventListener("load", testLoad, true);
michael@0 25 }
michael@0 26

mercurial