3 <title> Test case for bug
18655 </title>
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 file with content type does trigger onProgress event.
</p>
8 <p> You should see PASSED twice.
</p>
10 <p id=
"shouldBeCalled"> FAILED
</p>
11 <p id=
"shouldNotBeCalled"> PASSED
</p>
12 <script type=
"text/javascript">
13 if (window
.testRunner
) {
14 testRunner
.dumpAsText();
15 testRunner
.waitUntilDone();
19 function checkDone() {
20 if (++count
== 2 && window
.testRunner
)
21 testRunner
.notifyDone();
24 function onProgressPassed(e
) {
25 document
.getElementById("shouldBeCalled").innerHTML
= "PASSED";
28 function onProgressFailed(e
) {
29 document
.getElementById("shouldNotBeCalled").innerHTML
= "FAILED";
32 var req
= new XMLHttpRequest();
33 req
.onprogress
= onProgressPassed
;
34 req
.onload
= checkDone
;
35 // Test that onProgress is called on a normal file
36 req
.open("GET", "resources/1251.html", true);
39 // If content length is not given, it should not be called
40 var req2
= new XMLHttpRequest();
41 req2
.onprogress
= onProgressFailed
;
42 req2
.onload
= checkDone
;
43 req2
.open("GET", "resources/noContentLength.asis", true);