Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | <!DOCTYPE html> |
michael@0 | 2 | <html> |
michael@0 | 3 | <!-- |
michael@0 | 4 | https://bugzilla.mozilla.org/show_bug.cgi?id=414815 |
michael@0 | 5 | --> |
michael@0 | 6 | <head> |
michael@0 | 7 | <title>postMessage's interaction with a <base> tag</title> |
michael@0 | 8 | <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 9 | <script type="text/javascript" src="browserFu.js"></script> |
michael@0 | 10 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
michael@0 | 11 | <base href="http://example.com/" /> |
michael@0 | 12 | </head> |
michael@0 | 13 | <body> |
michael@0 | 14 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=414815">Mozilla Bug 414815</a> |
michael@0 | 15 | <p id="display"></p> |
michael@0 | 16 | <div id="content" style="display: none"></div> |
michael@0 | 17 | |
michael@0 | 18 | <pre id="test"> |
michael@0 | 19 | <script class="testbody" type="application/javascript"> |
michael@0 | 20 | /** Test for Bug 414815 **/ |
michael@0 | 21 | |
michael@0 | 22 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 23 | |
michael@0 | 24 | function receiveMessage(evt) |
michael@0 | 25 | { |
michael@0 | 26 | is(evt.origin, "http://mochi.test:8888", "wrong sender"); |
michael@0 | 27 | ok(evt.source === window, "wrong source"); |
michael@0 | 28 | |
michael@0 | 29 | is(evt.data, "generate-event", "wrong data"); |
michael@0 | 30 | is(evt.lastEventId, "", "wrong lastEventId"); |
michael@0 | 31 | |
michael@0 | 32 | SimpleTest.finish(); |
michael@0 | 33 | } |
michael@0 | 34 | |
michael@0 | 35 | window.addEventListener("message", receiveMessage, false); |
michael@0 | 36 | |
michael@0 | 37 | function run() |
michael@0 | 38 | { |
michael@0 | 39 | window.postMessage("generate-event", "http://mochi.test:8888"); |
michael@0 | 40 | } |
michael@0 | 41 | |
michael@0 | 42 | window.addEventListener("load", run, false); |
michael@0 | 43 | </script> |
michael@0 | 44 | </pre> |
michael@0 | 45 | </body> |
michael@0 | 46 | </html> |