Bug 1885602 - Part 5: Implement navigating to the SUMO help topic from the menu heade...
[gecko.git] / dom / bindings / test / test_jsimplemented_eventhandler.html
blob7b77604744001798fcfcf6c24403286140dab175
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=1186696
5 -->
6 <head>
7 <meta charset="utf-8">
8 <title>Test for Bug 1186696</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">
12 /* global TestInterfaceJS */
13 /** Test for Bug 1186696 **/
14 SimpleTest.waitForExplicitFinish();
16 function doTest() {
17 var values = [ function() {}, 5, null, undefined, "some string", {} ];
19 while (values.length) {
20 var value = values.pop();
21 var t = new TestInterfaceJS();
22 t.onsomething = value;
23 var gottenValue = t.onsomething;
24 if (typeof value == "object" || typeof value == "function") {
25 is(gottenValue, value, "Should get back the object-or-null we put in");
26 } else {
27 is(gottenValue, null, "Should get back null");
31 SimpleTest.finish();
34 SpecialPowers.pushPrefEnv({set: [["dom.expose_test_interfaces", true]]},
35 doTest);
36 </script>
37 </head>
38 <body>
39 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1186696">Mozilla Bug 1186696</a>
40 <p id="display"></p>
41 <div id="content" style="display: none">
43 </div>
44 <pre id="test">
45 </pre>
46 </body>
47 </html>