2 <?xml-stylesheet href=
"chrome://global/skin" type=
"text/css"?>
3 <?xml-stylesheet href=
"chrome://mochikit/content/tests/SimpleTest/test.css"
6 https://bugzilla.mozilla.org/show_bug.cgi?id=618176
8 <window title=
"Mozilla Bug 618176"
9 xmlns=
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
11 <label value=
"Mozilla Bug 618176"/>
12 <!-- test code goes here -->
13 <script type=
"application/javascript"><![CDATA[
14 /* global messageManager */
15 const TEST_PAGE = Services.io.newURI(
16 "data:text/html,<script>var a=[1,2,3];</script>Hi"
20 "data:,addEventListener('pageshow', function() { sendAsyncMessage('test', content.wrappedJSObject.a) }, false);";
21 // s/content.wrappedJSObject.a/[
1,
2,
3]/ and the test passes
23 function recvTest(m) {
25 window.arguments[
0].is(a.length,
3,
"array was serialized and deserialized");
27 messageManager.removeMessageListener(
"test", recvTest);
32 messageManager.addMessageListener(
"test", recvTest);
33 messageManager.loadFrameScript(FRAME_SCRIPT, true);
34 let triggeringPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
35 setTimeout(function () {
36 document.getElementById(
"browser").loadURI(TEST_PAGE, {triggeringPrincipal});
41 window.arguments[
0].setTimeout(function() { this.done(); },
0);
47 <browser id=
"browser" type=
"content" style=
"width: 200px; height: 200px;"/>