Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / xmlhttprequest-LSProgressEvent-ProgressEvent-should-match.html
blob6939296e5c2b52662648535c7ca2ba0599088420
1 <html>
2 <head>
3 <title> Test case for bug 18655 </title>
4 </head>
5 <body>
6 <p> Test case for Bug <a href="https://bugs.webkit.org/show_bug.cgi?id=18655">18655</a>: [XHR] OnProgress needs more test case </p>
7 <p> This test verify that we implement both interfaces and that they match. </p>
8 <p> You should see PASSED twice. </p>
10 <script type="text/javascript">
11 var count = 0;
13 function log (msg)
15 document.body.appendChild(document.createTextNode(msg));
16 document.body.appendChild(document.createElement("br"));
19 function onProgress(e) {
20 // Check if both interface match and they are not both null
21 // so that if it is not implemented it does not match.
22 if (e.position == e.loaded && e.loaded)
23 log("PASSED");
24 else
25 log("FAILED position and loaded do not match (or both are null)");
27 if (e.totalSize == e.total && e.total)
28 log("PASSED");
29 else
30 log("FAILED totalSize and total do not match (or both are null)");
32 if (++count == 1 && window.testRunner)
33 testRunner.notifyDone();
36 if (window.testRunner) {
37 testRunner.dumpAsText();
38 testRunner.waitUntilDone();
41 var req = new XMLHttpRequest();
42 req.onprogress = onProgress;
43 req.open("GET", "resources/1251.html", true);
44 req.send(null);
45 </script>
46 </body>
47 </html>