<html>
<head>
    <title> Test case for bug 18655 </title>
</head>
<body>
<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>
<p> This test verify that file with content type does trigger onProgress event. </p>
<p> You should see PASSED twice. </p>
<body>
<p id="result1"> FAILED </p>
<p id="result2"> FAILED </p>
<script type="text/javascript">
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}

var count = 0;
function checkDone() {
    if (++count == 2 && window.testRunner)
        testRunner.notifyDone();
}

function onProgressPassed(elementID) {
    document.getElementById(elementID).innerHTML = "PASSED";
}

var req = new XMLHttpRequest();
req.onprogress = function() { onProgressPassed("result1"); }
req.onload = checkDone;
// Test that onProgress is called on a normal file
req.open("GET", "resources/1251.html", true);
req.send(null);

var req2 = new XMLHttpRequest();
req2.onprogress = function() { onProgressPassed("result2"); }
req2.onload = checkDone;
req2.open("GET", "resources/noContentLength.cgi", true);
req2.send(null);

</script>
</body>
</html>
