file_sandbox_and_document_uri.html (1118B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <script src="/tests/SimpleTest/SimpleTest.js"></script> 5 <script src="/tests/SimpleTest/ChromeTask.js"></script> 6 <script> 7 function test() { 8 location.hash = "foobar" 9 if (!document.documentURI.includes("#foobar")) { 10 opener.postMessage("Wrong documentURI", "*"); 11 window.close(); 12 } else { 13 ChromeTask.spawn(null, () => { 14 return { 15 documentURI: actorParent.documentURI.spec, 16 principalURI: actorParent.documentPrincipal.URI.spec 17 }; 18 }).then((uriAndPrincipal) => { 19 if (!uriAndPrincipal.documentURI.includes("#foobar")) { 20 opener.postMessage("Wrong documentURI in the parent process", "*"); 21 } else if (!uriAndPrincipal.principalURI.includes("moz-nullprincipal")) { 22 opener.postMessage("Wrong document principal in the parent process", "*"); 23 } else { 24 opener.postMessage("done", "*"); 25 } 26 window.close(); 27 }); 28 } 29 } 30 </script> 31 </head> 32 <body onload="setTimeout(test)"> 33 </body> 34 </html>