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