4 https://bugzilla.mozilla.org/show_bug.cgi?id=478438
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;
16 if (test.calledAlready)
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");
50 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=478438">Mozilla Bug
478438</a>
53 <iframe id=
"f" src=
"http://example.com" onload=
"test()"></iframe>
56 <script type=
"application/javascript">
58 /** Test for Bug
478438 **/
60 SimpleTest.waitForExplicitFinish();