Bug 1942639 - Propagate --filter argument from desktop_unittest.py to runreftest...
[gecko.git] / dom / bindings / test / test_bug1041646.html
blob95550a98e2ad4799fba11938a03989ec518a2a3e
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=1041646
5 -->
6 <head>
7 <meta charset="utf-8">
8 <title>Test for Bug 1041646</title>
9 <script src="/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
11 <script type="application/javascript">
13 /** Test for Bug 1041646 **/
14 // We need to reject the promise with a DOMException, so make sure we have
15 // something that produces one.
16 function throwException() {
17 document.createTextNode("").appendChild(document);
19 try {
20 throwException();
21 } catch (e) {
22 ok(e instanceof DOMException, "This test won't test what it should be testing");
25 SimpleTest.waitForExplicitFinish();
27 // We want a new DOMException each time here.
28 for (var i = 0; i < 100; ++i) {
29 new Promise(throwException);
32 // Now make sure we wait for all those promises above to reject themselves
33 Promise.resolve(1).then(function() {
34 SpecialPowers.gc(); // This should not assert or crash
35 SimpleTest.finish();
36 });
38 </script>
39 </head>
40 <body>
41 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1041646">Mozilla Bug 1041646</a>
42 <p id="display"></p>
43 <div id="content" style="display: none">
45 </div>
46 <pre id="test">
47 </pre>
48 </body>
49 </html>