4 https://bugzilla.mozilla.org/show_bug.cgi?id=968335
8 <title>Test for Bug
968335</title>
9 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
11 <script type=
"application/javascript">
13 /** Test for Cu.getCallerPrincipal (within JS-implemented WebIDL). **/
15 SimpleTest.waitForExplicitFinish();
16 SpecialPowers.pushPrefEnv({set: [['dom.expose_test_interfaces', true]]}, go);
20 var t = new TestInterfaceJS();
21 is(t.getCallerPrincipal(), location.origin,
22 "Cu.getCallerPrincipal works right within JS-implemented WebIDL");
25 SpecialPowers.Cu.getWebIDLCallerPrincipal();
26 ok(false,
"Should have thrown");
28 ok(/NOT_AVAILABLE/.test(SpecialPowers.wrap(e)),
29 "API should throw when invoked outside of JS-implemented WebIDL");
41 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=968335">Mozilla Bug
968335</a>
43 <div id=
"content" style=
"display: none">