dom/tests/mochitest/bugs/test_bug291377.html

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:84ca2ae9f744
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=291377
5 -->
6 <head>
7 <title>Test for Bug 291377</title>
8 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
10 </head>
11 <body>
12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=291377">Mozilla Bug 291377</a>
13 <p id="display"></p>
14 <div id="content" style="display: none">
15
16 </div>
17 <pre id="test">
18 <script class="testbody" type="text/javascript">
19 /** Test for Bug 291377 **/
20 /* Do something that causes an XPConnect exception */
21 var threw = true;
22 try {
23 window.location.port = -2;
24 threw = false;
25 } catch (e) {
26 /* Check that we can touch various properties */
27 isnot(e.lineNumber, undefined, "Unexpected line number"); //This line number is dependent on the implementation of the SpecialPowers API
28 is(e.name, "NS_ERROR_MALFORMED_URI", "Unexpected exception name");
29 isnot(e.message, "", "Should have a message");
30 isnot(e.result, 0, "Should have a result");
31
32 is(e.result, SpecialPowers.Cr.NS_ERROR_MALFORMED_URI);
33 }
34
35 is(threw, true, "Not enough arguments to a call should throw");
36 </script>
37 </pre>
38 </body>
39 </html>
40

mercurial