Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / js / xpconnect / tests / mochitest / test_bug478438.html
blobe64a1e89fb5e985d46c97ff4e9c80c3f723b6f24
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=478438
5 -->
6 <head>
7 <title>Test for Bug 478438</title>
8 <script src="/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
10 <script type="application/javascript">
11 function fail(s, e) { ok(false, s + e) }
12 function pass(s, e) { ok(true, s) }
13 (pass.opposite = fail).opposite = pass;
15 function test() {
16 if (test.calledAlready)
17 return;
18 test.calledAlready = true;
20 var iwin = document.getElementById("f").contentWindow;
22 function testOne(fn, onAllow, infinitive) {
23 try { fn(); onAllow("able " + infinitive, "") }
24 catch (e) { onAllow.opposite("unable " + infinitive, ": " + e) }
27 testOne(() => iwin.focus, pass,
28 "to resolve/get allAccess property iwin.focus");
30 testOne(() => iwin.focus(), pass,
31 "to call allAccess method iwin.focus");
33 testOne(() => iwin.alert, fail,
34 "to resolve/get restricted property iwin.alert");
36 testOne(() => iwin.alert(), fail,
37 "to call restricted method iwin.alert");
39 testOne(() => iwin.location.toString(), fail,
40 "to call restricted method iwin.location.toString");
42 testOne(function() { iwin.location = "http://example.org" }, pass,
43 "to set writable property iwin.location");
45 SimpleTest.finish();
47 </script>
48 </head>
49 <body>
50 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=478438">Mozilla Bug 478438</a>
51 <p id="display"></p>
52 <div id="content">
53 <iframe id="f" src="http://example.com" onload="test()"></iframe>
54 </div>
55 <pre id="test">
56 <script type="application/javascript">
58 /** Test for Bug 478438 **/
60 SimpleTest.waitForExplicitFinish();
62 </script>
63 </pre>
64 </body>
65 </html>