Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / js / xpconnect / tests / chrome / file_bug618176.xhtml
blob3aea153159049428108b2b1690136878f1be7422
1 <?xml version="1.0"?>
2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
4 type="text/css"?>
5 <!--
6 https://bugzilla.mozilla.org/show_bug.cgi?id=618176
7 -->
8 <window title="Mozilla Bug 618176"
9 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
10 onload="start()">
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"
19 const FRAME_SCRIPT =
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) {
24 var a = m.json;
25 window.arguments[0].is(a.length, 3, "array was serialized and deserialized");
27 messageManager.removeMessageListener("test", recvTest);
28 finish();
31 function start() {
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});
37 }, 0);
40 function finish() {
41 window.arguments[0].setTimeout(function() { this.done(); }, 0);
42 window.close();
45 ]]></script>
47 <browser id="browser" type="content" style="width: 200px; height: 200px;"/>
48 </window>