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 | <?xml version="1.0"?> |
michael@0 | 2 | <?xml-stylesheet href="chrome://global/skin" type="text/css"?> |
michael@0 | 3 | <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" |
michael@0 | 4 | type="text/css"?> |
michael@0 | 5 | <!-- |
michael@0 | 6 | https://bugzilla.mozilla.org/show_bug.cgi?id=618176 |
michael@0 | 7 | --> |
michael@0 | 8 | <window title="Mozilla Bug 618176" |
michael@0 | 9 | xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" |
michael@0 | 10 | onload="start()"> |
michael@0 | 11 | <label value="Mozilla Bug 618176"/> |
michael@0 | 12 | <!-- test code goes here --> |
michael@0 | 13 | <script type="application/javascript"><![CDATA[ |
michael@0 | 14 | |
michael@0 | 15 | const TEST_PAGE = |
michael@0 | 16 | "data:text/html,<script>var a=[1,2,3];</script>Hi"; |
michael@0 | 17 | |
michael@0 | 18 | const FRAME_SCRIPT = |
michael@0 | 19 | "data:,addEventListener('pageshow', function() { sendAsyncMessage('test', content.wrappedJSObject.a) }, false);"; |
michael@0 | 20 | // s/content.wrappedJSObject.a/[ 1, 2, 3]/ and the test passes |
michael@0 | 21 | |
michael@0 | 22 | function recvTest(m) { |
michael@0 | 23 | var a = m.json; |
michael@0 | 24 | opener.wrappedJSObject.is(a.length, 3, "array was serialized and deserialized"); |
michael@0 | 25 | |
michael@0 | 26 | messageManager.removeMessageListener("test", recvTest); |
michael@0 | 27 | finish(); |
michael@0 | 28 | } |
michael@0 | 29 | |
michael@0 | 30 | function start() { |
michael@0 | 31 | messageManager.addMessageListener("test", recvTest); |
michael@0 | 32 | messageManager.loadFrameScript(FRAME_SCRIPT, true); |
michael@0 | 33 | setTimeout(function () { document.getElementById("browser").loadURI(TEST_PAGE); }, 0); |
michael@0 | 34 | } |
michael@0 | 35 | |
michael@0 | 36 | function finish() { |
michael@0 | 37 | opener.setTimeout("done()", 0); |
michael@0 | 38 | window.close(); |
michael@0 | 39 | } |
michael@0 | 40 | |
michael@0 | 41 | ]]></script> |
michael@0 | 42 | |
michael@0 | 43 | <browser id="browser" type="content" style="width: 200px; height: 200px;"/> |
michael@0 | 44 | </window> |