Thu, 15 Jan 2015 15:55:04 +0100
Back out 97036ab72558 which inappropriately compared turds to third parties.
1 <!DOCTYPE html>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=430251
5 -->
6 <head>
7 <title>postMessage's interaction with pages at jar: URIs</title>
8 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
9 <script type="text/javascript" src="browserFu.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
11 <base href="http://mochi.test:8888/" />
12 </head>
13 <body>
14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=430251">Mozilla Bug 430251</a>
15 <p id="display"></p>
16 <div id="content" style="display: none"></div>
18 <iframe src="jar:http://mochi.test:8888/tests/dom/tests/mochitest/whatwg/postMessage.jar!/postMessage_jar.html"
19 name="kid"></iframe>
21 <pre id="test">
22 <script class="testbody" type="application/javascript">
23 /** Test for Bug 430251 **/
25 SimpleTest.waitForExplicitFinish();
27 function receiveMessage(evt)
28 {
29 is(evt.origin, "http://mochi.test:8888", "wrong sender");
30 ok(evt.source === window.frames.kid, "wrong source");
32 is(evt.data, "finish-test", "wrong data");
33 is(evt.lastEventId, "", "wrong lastEventId");
35 SimpleTest.finish();
36 }
38 window.addEventListener("message", receiveMessage, false);
40 function run()
41 {
42 window.frames.kid.postMessage("start-test", "http://mochi.test:8888");
43 }
45 window.addEventListener("load", run, false);
46 </script>
47 </pre>
48 </body>
49 </html>