|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=462787 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 462787</title> |
|
8 <script type="application/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=462787">Mozilla Bug 462787</a> |
|
13 <p id="display"></p> |
|
14 <div id="content" style="display: none"> |
|
15 |
|
16 </div> |
|
17 <pre id="test"> |
|
18 <script type="application/javascript"> |
|
19 |
|
20 /** Test for Bug 462787 **/ |
|
21 |
|
22 function do_test() { |
|
23 const INVALID_POINTER = SpecialPowers.Cr.NS_ERROR_INVALID_POINTER; |
|
24 |
|
25 var utils = SpecialPowers.Cc["@mozilla.org/inspector/dom-utils;1"] |
|
26 .getService(SpecialPowers.Ci.inIDOMUtils); |
|
27 try { |
|
28 utils.getCSSStyleRules(null); |
|
29 ok(false, "expected an exception"); |
|
30 } |
|
31 catch(e) { |
|
32 e = SpecialPowers.wrap(e); |
|
33 is(e.result, INVALID_POINTER, "got the expected exception"); |
|
34 } |
|
35 |
|
36 try { |
|
37 utils.getRuleLine(null); |
|
38 ok(false, "expected an exception"); |
|
39 } |
|
40 catch(e) { |
|
41 e = SpecialPowers.wrap(e); |
|
42 is(e.result, INVALID_POINTER, "got the expected exception"); |
|
43 } |
|
44 |
|
45 try { |
|
46 utils.isIgnorableWhitespace(null); |
|
47 ok(false, "expected an exception"); |
|
48 } |
|
49 catch(e) { |
|
50 e = SpecialPowers.wrap(e); |
|
51 is(e.result, INVALID_POINTER, "got the expected exception"); |
|
52 } |
|
53 |
|
54 try { |
|
55 utils.getParentForNode(null, true); |
|
56 ok(false, "expected an exception"); |
|
57 } |
|
58 catch(e) { |
|
59 e = SpecialPowers.wrap(e); |
|
60 is(e.result, INVALID_POINTER, "got the expected exception"); |
|
61 } |
|
62 |
|
63 try { |
|
64 utils.getBindingURLs(null); |
|
65 ok(false, "expected an exception"); |
|
66 } |
|
67 catch(e) { |
|
68 e = SpecialPowers.wrap(e); |
|
69 is(e.result, INVALID_POINTER, "got the expected exception"); |
|
70 } |
|
71 |
|
72 try { |
|
73 utils.getContentState(null); |
|
74 ok(false, "expected an exception"); |
|
75 } |
|
76 catch(e) { |
|
77 e = SpecialPowers.wrap(e); |
|
78 is(e.result, INVALID_POINTER, "got the expected exception"); |
|
79 } |
|
80 |
|
81 try { |
|
82 utils.setContentState(null, false); |
|
83 ok(false, "expected an exception"); |
|
84 } |
|
85 catch(e) { |
|
86 e = SpecialPowers.wrap(e); |
|
87 is(e.result, INVALID_POINTER, "got the expected exception"); |
|
88 } |
|
89 |
|
90 SimpleTest.finish(); |
|
91 } |
|
92 |
|
93 SimpleTest.waitForExplicitFinish(); |
|
94 addLoadEvent(do_test); |
|
95 |
|
96 |
|
97 </script> |
|
98 </pre> |
|
99 </body> |
|
100 </html> |