blob: bf89020c124aa368b0858d9c4816b5d473348c0e [file] [log] [blame]
akuang@microsoft.com61b5a382012-10-26 14:19:051<!DOCTYPE html>
2<html>
3<head>
akuang@microsoft.com61b5a382012-10-26 14:19:054 <script src="/resources/testharness.js"></script>
Hallvord Reiar M. Steen99eeb102013-05-24 09:16:015 <title>XMLHttpRequest: The send() method: Fire a progress event named loadend (no response entity body)</title>
Hallvord Reiar M. Steend728ca62013-05-24 11:52:266 <link rel="help" href="http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#handler-xhr-onloadend" data-tested-assertations="/../.." />
7 <link rel="help" href="http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#event-xhr-loadend" data-tested-assertations="/../.." />
Hallvord Reiar M. Steen5a807382013-05-24 12:42:178 <link rel="help" href="http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#infrastructure-for-the-send()-method" data-tested-assertations="following::dt[10] /following-sibling::ol/li[10]" />
akuang@microsoft.com61b5a382012-10-26 14:19:059</head>
10
11<body>
12 <div id="log"></div>
13
14 <script type="text/javascript">
15 var test = async_test();
16
Hallvord Reiar M. Steend728ca62013-05-24 11:52:2617 test.step(function ()
akuang@microsoft.com61b5a382012-10-26 14:19:0518 {
19 var xhr = new XMLHttpRequest();
20
Hallvord Reiar M. Steend728ca62013-05-24 11:52:2621 xhr.onreadystatechange = function()
akuang@microsoft.com61b5a382012-10-26 14:19:0522 {
Hallvord Reiar M. Steend728ca62013-05-24 11:52:2623 test.step(function()
akuang@microsoft.com61b5a382012-10-26 14:19:0524 {
Hallvord Reiar M. Steend728ca62013-05-24 11:52:2625 if (xhr.readyState == 4)
akuang@microsoft.com61b5a382012-10-26 14:19:0526 {
27 assert_equals(xhr.response, "");
28 }
29 });
30 };
31
Hallvord Reiar M. Steend728ca62013-05-24 11:52:2632 xhr.onloadend = function(e)
akuang@microsoft.com61b5a382012-10-26 14:19:0533 {
Hallvord Reiar M. Steend728ca62013-05-24 11:52:2634 test.step(function()
akuang@microsoft.com61b5a382012-10-26 14:19:0535 {
36 assert_true(e instanceof ProgressEvent);
37 assert_equals(e.type, "loadend");
38 test.step(function() { test.done(); });
39 });
40 };
41
Hallvord Reiar M. Steen563ff3b2013-05-23 12:11:1442 xhr.open("POST", "./resources/content.php", true);
akuang@microsoft.com61b5a382012-10-26 14:19:0543 xhr.send();
44 });
45 </script>
46</body>
47</html>