Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / onloadstart-event.html
blob7a94834aa57999748c25ce75d44ac742792765ce
1 <html>
2 <body>
3 <p>This test that the loadstart event is fired for XMLHttpRequests</p>
4 <pre id='console'></pre>
5 <script type="text/javascript">
6 if (window.testRunner) {
7 testRunner.dumpAsText();
8 testRunner.waitUntilDone();
11 function log(message)
13 document.getElementById('console').appendChild(document.createTextNode(message + "\n"));
16 var xhr;
18 function loadstartHandler(evt)
20 log("PASS: loadstart event fired.");
23 function readystatechangeHandler(evt)
25 if (xhr.readyState == xhr.DONE) {
26 if (window.testRunner)
27 testRunner.notifyDone();
31 xhr = new XMLHttpRequest;
32 xhr.onloadstart = loadstartHandler;
33 xhr.onreadystatechange = readystatechangeHandler;
34 xhr.open("GET", "resources/get.txt", true);
35 xhr.send();
36 </script>
37 </body>
38 </html>