tor-browser

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

test_bug440572.html (1664B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=440572
      5 -->
      6 <head>
      7  <title>Test for Bug 440572</title>
      8  <script src="/tests/SimpleTest/SimpleTest.js"></script>        
      9  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     10 </head>
     11 <body>
     12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=440572">Mozilla Bug 440572</a>
     13 
     14 <script class="testbody" type="text/javascript">
     15 
     16 /** Test for Bug 440572 */
     17 
     18 var messages = new Map();
     19 
     20 function receiveMessage(e)
     21 {
     22  is(e.origin, "http://example.org", "wrong sender!");
     23  messages.set(e.data.from, e.data.result);
     24  // Runtests after receiving the right number of messages.
     25  if (messages.size == 4) {
     26    runtests();
     27  }
     28 }
     29 
     30 window.addEventListener("message", receiveMessage);
     31 
     32 function runtests()
     33 {
     34  is(messages.get("test"), "success", "test in frame failed.");
     35  is(messages.get("dump"), "success", '"dump" in frame failed.');
     36  is(messages.get("open"), "success", '"open" in frame failed.');
     37  isnot(messages.get("close"), "success", "parent[\"close\"] should be the WebIDL property of Window.");
     38 
     39  SimpleTest.finish();
     40 }
     41 
     42 SimpleTest.waitForExplicitFinish();
     43 </script>
     44 <br>
     45 <iframe name="test" src="http://example.org:80/tests/dom/tests/mochitest/bugs/iframe_bug440572.html"></iframe>
     46 <br>
     47 <iframe name="dump" src="http://example.org:80/tests/dom/tests/mochitest/bugs/iframe_bug440572.html"></iframe>
     48 <br>
     49 <iframe name="open" src="http://example.org:80/tests/dom/tests/mochitest/bugs/iframe_bug440572.html"></iframe>
     50 <br>
     51 <iframe name="close" src="http://example.org:80/tests/dom/tests/mochitest/bugs/iframe_bug440572.html"></iframe>
     52 </body>
     53 </html>