dom/tests/mochitest/bugs/test_bug291377.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/tests/mochitest/bugs/test_bug291377.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,40 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=291377
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 291377</title>
    1.11 +  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
    1.12 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    1.13 +</head>
    1.14 +<body>
    1.15 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=291377">Mozilla Bug 291377</a>
    1.16 +<p id="display"></p>
    1.17 +<div id="content" style="display: none">
    1.18 +  
    1.19 +</div>
    1.20 +<pre id="test">
    1.21 +<script class="testbody" type="text/javascript">
    1.22 +/** Test for Bug 291377 **/
    1.23 +/* Do something that causes an XPConnect exception */
    1.24 +var threw = true;
    1.25 +try {
    1.26 +  window.location.port = -2;
    1.27 +  threw = false;
    1.28 +} catch (e) {
    1.29 +  /* Check that we can touch various properties */
    1.30 +  isnot(e.lineNumber, undefined, "Unexpected line number"); //This line number is dependent on the implementation of the SpecialPowers API
    1.31 +  is(e.name, "NS_ERROR_MALFORMED_URI", "Unexpected exception name");
    1.32 +  isnot(e.message, "", "Should have a message");
    1.33 +  isnot(e.result, 0, "Should have a result");
    1.34 +  
    1.35 +  is(e.result, SpecialPowers.Cr.NS_ERROR_MALFORMED_URI);
    1.36 +}
    1.37 +
    1.38 +is(threw, true, "Not enough arguments to a call should throw");
    1.39 +</script>
    1.40 +</pre>
    1.41 +</body>
    1.42 +</html>
    1.43 +

mercurial