content/media/test/test_access_control.html

branch
TOR_BUG_3246
changeset 7
129ffea94266
equal deleted inserted replaced
-1:000000000000 0:6f001ce64475
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=451958
5 -->
6 <head>
7 <title>Test for Bug 451958</title>
8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
10 <script type="text/javascript" src="manifest.js"></script>
11 </head>
12 <body>
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=451958">Mozilla Bug 451958</a>
14 <p id="display"></p>
15 <div id="content" style="display: none">
16 </div>
17 <pre id="test">
18 <script type="application/javascript">
19
20 /** Test for Bug 451958 **/
21
22 function run() {
23 window.open("http://example.org:80/tests/content/media/test/file_access_controls.html", "", "width=500,height=500");
24 }
25
26 function done() {
27 mediaTestCleanup();
28 SimpleTest.finish();
29 }
30
31 addLoadEvent(run);
32 SimpleTest.waitForExplicitFinish();
33
34
35 window.addEventListener("message", receiveMessage, false);
36
37 function receiveMessage(event)
38 {
39 if (event.origin !== "http://example.org") {
40 ok(false, "Received message from wrong domain");
41 return;
42 }
43
44 if (event.data.done == "true")
45 return done();
46
47 ok(event.data.result, event.data.message);
48 }
49 </script>
50 </pre>
51 </body>
52 </html>

mercurial