tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_uir_windowwatcher.html (1002B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <title>Bug 1529893 - Test upgrade-insecure-requests for opening window through nsWindowWatcher</title>
      6  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      7  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
      8 </head>
      9 <body>
     10 
     11 <iframe name='frameA' width="100%" src="http://example.com/tests/dom/security/test/csp/file_windowwatcher_frameA.html"></iframe>
     12 
     13 <script class="testbody" type="text/javascript">
     14 
     15 // The CSP of subframe C should cause the window to be opened to be upgraded from http to https.
     16 
     17 SimpleTest.waitForExplicitFinish();
     18 
     19 let finalURI = "https://example.com/tests/dom/security/test/csp/file_windowwatcher_win_open.html";
     20 
     21 window.addEventListener("message", receiveMessage);
     22 
     23 function receiveMessage(event) {
     24  is(event.data.result, finalURI, "opened window correctly upgraded to https");
     25  window.removeEventListener("message", receiveMessage);
     26  SimpleTest.finish();
     27 }
     28 
     29 </script>
     30 </body>
     31 </html>