From e4e5056a321fa1d6622d2a292abf5e96aa178556 Mon Sep 17 00:00:00 2001 From: "Hallvord Reiar M. Steen" Date: Tue, 21 May 2013 22:51:23 +0200 Subject: [PATCH] reversing expected order to align with spec --- XMLHttpRequest/abort-event-order.htm | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/XMLHttpRequest/abort-event-order.htm b/XMLHttpRequest/abort-event-order.htm index 1fd5dbb6c70afd..a7e70906c21c0b 100644 --- a/XMLHttpRequest/abort-event-order.htm +++ b/XMLHttpRequest/abort-event-order.htm @@ -1,9 +1,9 @@  - + - XMLHttpRequest L2: The abort() method: abort and loadend events + XMLHttpRequest: The abort() method: abort and loadend events @@ -15,8 +15,7 @@ test.step(function() { var xhr = new XMLHttpRequest(); - var initialized = false; - var expect = [4, "upload.abort", "upload.loadend", "abort", "loadend"]; + var expect = [4, "abort", "loadend", "upload.abort", "upload.loadend"]; var actual = []; xhr.onreadystatechange = function() @@ -27,23 +26,19 @@ if (readyState == 1) { - if (initialized) - { - xhr.abort(); - } - initialized = true; + xhr.abort(); } - else if (readyState == 4) + else if (readyState == 4) { actual.push(readyState); } }); }; - xhr.onloadend = function(e){ actual.push(e.type); VerifyResult()}; + xhr.onloadend = function(e){ actual.push(e.type); }; xhr.onabort = function(e){ actual.push(e.type); }; - xhr.upload.onloadend = function(e){ actual.push("upload." + e.type);}; + xhr.upload.onloadend = function(e){ actual.push("upload." + e.type); VerifyResult() }; xhr.upload.onabort = function(e){ actual.push("upload." + e.type); }; function VerifyResult() @@ -55,7 +50,7 @@ }); }; - xhr.open("POST", "./support/echo.php", true); + xhr.open("POST", "./resources/content.php", true); xhr.send("Test Message"); });