Bug 1852740: add tests for the `fetchpriority` attribute in Link headers. r=necko...
[gecko.git] / dom / xul / test / test_bug1070049_throw_from_script.xhtml
blobb9c635efd655fcff65d646bb407d9b7072c9b58c
1 <?xml version="1.0"?>
2 <?xml-stylesheet type="text/css" href="chrome://global/skin"?>
3 <?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
4 <!--
5 https://bugzilla.mozilla.org/show_bug.cgi?id=1070049
6 -->
7 <window title="Mozilla Bug 1070049"
8 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
9 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
11 <!-- test code goes here -->
12 <script type="application/javascript">
13 <![CDATA[
15 /** Test for Bug 1070049 **/
16 SimpleTest.waitForExplicitFinish();
17 addLoadEvent(function() {
18 // Prevent the test from failing when the exception hits onerror.
19 SimpleTest.expectUncaughtException();
21 // Tell the test to expect exactly one console error with the given parameters,
22 // with SimpleTest.finish as a continuation function.
23 SimpleTest.monitorConsole(SimpleTest.finish, [{errorMessage: new RegExp('flimfniffle')}]);
25 // Schedule the console accounting (and continuation) to run next, right
26 // after we throw (below).
27 SimpleTest.executeSoon(SimpleTest.endMonitorConsole);
29 // Throw.
30 throw "flimfniffle";
31 });
32 ]]>
33 </script>
35 <!-- test results are displayed in the html:body -->
36 <body xmlns="http://www.w3.org/1999/xhtml">
37 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1070049"
38 target="_blank">Mozilla Bug 1070049</a>
39 </body>
40 </window>