|
1 <html xmlns="http://www.w3.org/1999/xhtml"> |
|
2 <!-- |
|
3 https://bugzilla.mozilla.org/show_bug.cgi?id=872273 |
|
4 --> |
|
5 <head> |
|
6 <bindings xmlns="http://www.mozilla.org/xbl"> |
|
7 <binding id="foo"> |
|
8 <implementation> |
|
9 <method name="throwSomething" exposeToUntrustedContent="true"> |
|
10 <body> |
|
11 throw new Error("foopy"); |
|
12 </body> |
|
13 </method> |
|
14 </implementation> |
|
15 </binding> |
|
16 </bindings> |
|
17 <title>Test for Bug 872273</title> |
|
18 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
19 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
20 </head> |
|
21 <body> |
|
22 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=872273">Mozilla Bug 872273</a> |
|
23 <p id="display" style="-moz-binding: url(#foo)"></p> |
|
24 <div id="content" style="display: none"> |
|
25 </div> |
|
26 <pre id="test"> |
|
27 <script type="application/javascript"> |
|
28 <![CDATA[ |
|
29 |
|
30 /** Test for Bug 872273 **/ |
|
31 SimpleTest.waitForExplicitFinish(); |
|
32 addLoadEvent(function() { |
|
33 |
|
34 // Prevent the test from failing when the exception hits onerror. |
|
35 SimpleTest.expectUncaughtException(); |
|
36 |
|
37 // Tell the test to expect exactly one console error with the given parameters, |
|
38 // with SimpleTest.finish as a continuation function. |
|
39 SimpleTest.monitorConsole(SimpleTest.finish, [{errorMessage: new RegExp('foopy')}]); |
|
40 |
|
41 // Schedule the console accounting (and continuation) to run next, right |
|
42 // after we throw (below). |
|
43 SimpleTest.executeSoon(SimpleTest.endMonitorConsole); |
|
44 |
|
45 // Throw. |
|
46 $('display').throwSomething(); |
|
47 }); |
|
48 |
|
49 ]]> |
|
50 </script> |
|
51 </pre> |
|
52 </body> |
|
53 </html> |