Bug 1941128 - Turn off network.dns.native_https_query on Mac again
[gecko.git] / dom / bindings / test / test_exceptionThrowing.html
blob571d21b485a5f867cdf36b5f33f7bcd626c303a9
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=847119
5 -->
6 <head>
7 <meta charset="utf-8">
8 <title>Test for Bug 847119</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 847119 **/
15 var xhr = new XMLHttpRequest();
16 var domthrows = function() { xhr.open(); };
18 var count = 20000;
20 function f() {
21 var k = 0;
22 for (var j = 0; j < count; ++j) {
23 try { domthrows(); } catch (e) { ++k; }
25 return k;
27 function g() { return count; }
29 is(f(), count, "Should get count exceptions");
30 for (let h of [f, g]) {
31 try { is(h(), count, "Should get count exceptions here too"); } catch (e) {}
33 ok(true, "We should get here");
35 domthrows = function() { xhr.withCredentials = false; };
36 xhr.open("GET", "");
37 xhr.send();
39 is(f(), count, "Should get count exceptions from getter");
40 for (let h of [f, g]) {
41 try { is(h(), count, "Should get count exceptions from getter here too"); } catch (e) {}
43 ok(true, "We should get here too");
45 </script>
46 </head>
47 <body>
48 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=847119">Mozilla Bug 847119</a>
49 <p id="display"></p>
50 <div id="content" style="display: none">
52 </div>
53 <pre id="test">
54 </pre>
55 </body>
56 </html>