blob: d897a71109e24dc9946a659c4dd4dffe40c59f02 [file] [log] [blame]
<!doctype html>
<title>ProgressEvent: firing events for HTTP with Content-Length</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel="help" href="" data-tested-assertations="/following-sibling::ol/li[1] /following-sibling::ol/li[2]" />
<div id="log"></div>
var test = async_test();
test.step(function() {
var xhr = new XMLHttpRequest();
xhr.onprogress = function(pe) {
test.step(function() {
if(pe.type == "progress") {
assert_true(pe.loaded >= 0, "loaded is initialize to the number of HTTP entity body bytes transferred.");
assert_true(pe.lengthComputable, "lengthComputable is true.");
assert_not_equals(, 0, "total is not zero.");
}, "Check lengthComputed, loaded, total when Content-Length is given.");
// "loadstart", "error", "abort", "load" tests are out of scope.
// They SHOULD be tested in each spec that implement ProgressEvent.
xhr.onloadend = function(pe) {
}"GET", "resources/img.jpg", true);