layout/inspector/tests/test_bug462787.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/inspector/tests/test_bug462787.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,100 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=462787
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 462787</title>
    1.11 +  <script type="application/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=462787">Mozilla Bug 462787</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 type="application/javascript">
    1.22 +
    1.23 +/** Test for Bug 462787 **/
    1.24 +
    1.25 +function do_test() {
    1.26 +  const INVALID_POINTER = SpecialPowers.Cr.NS_ERROR_INVALID_POINTER;
    1.27 +
    1.28 +  var utils = SpecialPowers.Cc["@mozilla.org/inspector/dom-utils;1"]
    1.29 +                             .getService(SpecialPowers.Ci.inIDOMUtils);
    1.30 +  try {
    1.31 +    utils.getCSSStyleRules(null); 
    1.32 +    ok(false, "expected an exception"); 
    1.33 +  }
    1.34 +  catch(e) {
    1.35 +    e = SpecialPowers.wrap(e);
    1.36 +    is(e.result, INVALID_POINTER, "got the expected exception");
    1.37 +  }
    1.38 +
    1.39 +  try {
    1.40 +    utils.getRuleLine(null); 
    1.41 +    ok(false, "expected an exception"); 
    1.42 +  }
    1.43 +  catch(e) {
    1.44 +    e = SpecialPowers.wrap(e);
    1.45 +    is(e.result, INVALID_POINTER, "got the expected exception");
    1.46 +  }
    1.47 +
    1.48 +  try {
    1.49 +    utils.isIgnorableWhitespace(null);
    1.50 +    ok(false, "expected an exception");
    1.51 +  }
    1.52 +  catch(e) {
    1.53 +    e = SpecialPowers.wrap(e);
    1.54 +    is(e.result, INVALID_POINTER, "got the expected exception");
    1.55 +  }
    1.56 +
    1.57 +  try {
    1.58 +    utils.getParentForNode(null, true); 
    1.59 +    ok(false, "expected an exception");
    1.60 +  }
    1.61 +  catch(e) {
    1.62 +    e = SpecialPowers.wrap(e);
    1.63 +    is(e.result, INVALID_POINTER, "got the expected exception");
    1.64 +  }
    1.65 +
    1.66 +  try {
    1.67 +    utils.getBindingURLs(null); 
    1.68 +    ok(false, "expected an exception"); 
    1.69 +  }
    1.70 +  catch(e) {
    1.71 +    e = SpecialPowers.wrap(e);
    1.72 +    is(e.result, INVALID_POINTER, "got the expected exception");
    1.73 +  }
    1.74 +
    1.75 +  try {
    1.76 +    utils.getContentState(null); 
    1.77 +    ok(false, "expected an exception"); 
    1.78 +  }
    1.79 +  catch(e) {
    1.80 +    e = SpecialPowers.wrap(e);
    1.81 +    is(e.result, INVALID_POINTER, "got the expected exception");
    1.82 +  }
    1.83 +
    1.84 +  try {
    1.85 +    utils.setContentState(null, false); 
    1.86 +    ok(false, "expected an exception"); 
    1.87 +  }
    1.88 +  catch(e) {
    1.89 +    e = SpecialPowers.wrap(e);
    1.90 +    is(e.result, INVALID_POINTER, "got the expected exception");
    1.91 +  }
    1.92 +
    1.93 +  SimpleTest.finish();
    1.94 +}
    1.95 +
    1.96 +SimpleTest.waitForExplicitFinish();
    1.97 +addLoadEvent(do_test);
    1.98 +
    1.99 +
   1.100 +</script>
   1.101 +</pre>
   1.102 +</body>
   1.103 +</html>

mercurial