Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / upload-onloadstart-event.html
blob74293dd4f36ca81d31039085d1294b5cd39c2185
1 <html>
2 <body>
3 <p>This test that the loadstart event is fired for XMLHttpRequestUpload objects.</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 on XMLHttpRequestUpload.");
23 function readystatechangeHandler(evt)
25 if (xhr.readyState == xhr.DONE) {
26 if (window.testRunner)
27 testRunner.notifyDone();
31 xhr = new XMLHttpRequest;
32 xhr.upload.onloadstart = loadstartHandler;
33 xhr.onreadystatechange = readystatechangeHandler;
34 xhr.open("POST", "resources/post-echo.cgi", true);
35 xhr.send("data");
36 </script>
37 </body>
38 </html>