test_bug291377.html (1231B)
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 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 is(e.message, "", "Should not have a message for this case"); 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, "We need a different testcase for XPConnect exceptions?"); 36 </script> 37 </pre> 38 </body> 39 </html>