From 319668b74305a0ef0d0eaa93bd1bce99d302e127 Mon Sep 17 00:00:00 2001 From: "Hallvord Reiar M. Steen" Date: Tue, 21 May 2013 22:41:26 +0200 Subject: [PATCH] removing isInitialized workaround for the double readystatechange event that should no longer be sent per spec --- XMLHttpRequest/abort-event-abort.htm | 25 ++++++++++--------------- XMLHttpRequest/abort-event-loadend.htm | 19 +++++++------------ 2 files changed, 17 insertions(+), 27 deletions(-) diff --git a/XMLHttpRequest/abort-event-abort.htm b/XMLHttpRequest/abort-event-abort.htm index a8fbd24c863a1f..ac23ebd45573e2 100644 --- a/XMLHttpRequest/abort-event-abort.htm +++ b/XMLHttpRequest/abort-event-abort.htm @@ -1,9 +1,9 @@  - + - XMLHttpRequest L2: The abort() method: Fire a progress event named abort + XMLHttpRequest: The abort() method: Fire a progress event named abort @@ -15,34 +15,29 @@ test.step(function() { var xhr = new XMLHttpRequest(); - var initialized = false; - xhr.onreadystatechange = function() + xhr.onreadystatechange = function() { - test.step(function() + test.step(function() { - if (xhr.readyState == 1) + if (xhr.readyState == 1) { - if (initialized) - { - xhr.abort(); - } - initialized = true; + xhr.abort(); } }); }; - xhr.onabort = function(e) + xhr.onabort = function(e) { - test.step(function() + test.step(function() { assert_true(e instanceof ProgressEvent); assert_equals(e.type, "abort"); - test.done(); + test.done(); }); }; - xhr.open("GET", "./support/echo.php", true); + xhr.open("GET", "./resources/content.php", true); xhr.send(); }); diff --git a/XMLHttpRequest/abort-event-loadend.htm b/XMLHttpRequest/abort-event-loadend.htm index 612055d534cde6..948d4e00c921ec 100644 --- a/XMLHttpRequest/abort-event-loadend.htm +++ b/XMLHttpRequest/abort-event-loadend.htm @@ -1,9 +1,9 @@  - + - XMLHttpRequest L2: The abort() method: Fire a progress event named loadend + XMLHttpRequest: The abort() method: Fire a progress event named loadend @@ -15,34 +15,29 @@ test.step(function() { var xhr = new XMLHttpRequest(); - var initialized = false; xhr.onreadystatechange = function() { test.step(function() { - if (xhr.readyState == 1) + if (xhr.readyState == 1) { - if (initialized) - { - xhr.abort(); - } - initialized = true; + xhr.abort(); } }); }; xhr.onloadend = function(e) { - test.step(function() + test.step(function() { assert_true(e instanceof ProgressEvent); assert_equals(e.type, "loadend"); - test.done(); + test.done(); }); }; - xhr.open("GET", "./support/echo.php", true); + xhr.open("GET", "./resources/content.php", true); xhr.send(); });