Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / access-control-repeated-failed-preflight-crash.html
blobce62980ccc2781590a1f7ae1109c1016b1f5c6bc
1 <base href="http://localhost:8000/"></base>
2 <script>
3 if (window.testRunner) {
4 testRunner.dumpAsText();
5 testRunner.waitUntilDone();
8 var requestCount = 0;
10 function preflightRequest() {
11 var xhr = new XMLHttpRequest();
12 xhr.onsuccess = function() { finish("FAIL"); }
13 xhr.onerror = function() {
14 if (requestCount == 5) {
15 finish("PASS");
16 return;
18 requestCount++;
19 // This hack of showing and hiding the inspector greatly increases the likelihood
20 // that references to the CachedResource underlying the XHR get cleaned out.
21 if (window.testRunner) {
22 testRunner.showWebInspector();
23 testRunner.closeWebInspector();
25 preflightRequest();
27 xhr.open("GET", "xmlhttprequest/resources/access-control-basic-denied.cgi");
28 xhr.send();
31 function finish(result) {
32 document.body.appendChild(document.createTextNode(result));
33 if (window.testRunner)
34 testRunner.notifyDone();
36 </script>
37 <body onload="preflightRequest()"></body>