Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / sync-after-async-same-resource.html
blob4d4019d60e501cee2e73d10d43e469acd534e64c
1 <body>
2 <script>
3 if (window.testRunner) {
4 testRunner.dumpAsText();
5 testRunner.waitUntilDone();
8 var asyncFinished = false;
9 var syncFinished = false;
11 function finish() {
12 if (asyncFinished && syncFinished)
13 testRunner.notifyDone();
17 var asyncxhr = new XMLHttpRequest();
18 asyncxhr.onreadystatechange = function() {
19 if (asyncxhr.readyState != 4)
20 return;
21 asyncFinished = true;
22 finish();
24 asyncxhr.open("GET", "resources/get.txt", true);
25 asyncxhr.send();
27 var syncxhr = new XMLHttpRequest();
28 syncxhr.open("GET", "resources/get.txt", false);
29 syncxhr.send();
30 document.body.appendChild(document.createTextNode(syncxhr.responseText));
31 syncFinished = true;
33 finish();
34 </script>
35 </body>