1 add_task(async function test() {
2 const uris = [undefined, "about:blank"];
4 function checkContentProcess(newBrowser, uri) {
5 return ContentTask.spawn(newBrowser, [uri], async function (uri) {
6 var prin = content.document.nodePrincipal;
10 "Loaded principal must not be null when adding " + uri
15 "Loaded principal must not be undefined when loading " + uri
19 prin.isSystemPrincipal,
21 "Loaded principal must not be system when loading " + uri
26 for (var uri of uris) {
27 await BrowserTestUtils.withNewTab(
29 async function (newBrowser) {
30 let loadedPromise = BrowserTestUtils.browserLoaded(newBrowser);
31 BrowserTestUtils.startLoadingURIString(newBrowser, uri);
33 var prin = newBrowser.contentPrincipal;
37 "Forced principal must not be null when loading " + uri
42 "Forced principal must not be undefined when loading " + uri
45 prin.isSystemPrincipal,
47 "Forced principal must not be system when loading " + uri
50 // Belt-and-suspenders e10s check: make sure that the same checks hold
51 // true in the content process.
52 await checkContentProcess(newBrowser, uri);
56 prin = newBrowser.contentPrincipal;
60 "Loaded principal must not be null when adding " + uri
65 "Loaded principal must not be undefined when loading " + uri
68 prin.isSystemPrincipal,
70 "Loaded principal must not be system when loading " + uri
73 // Belt-and-suspenders e10s check: make sure that the same checks hold
74 // true in the content process.
75 await checkContentProcess(newBrowser, uri);