Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Unified Diff: LayoutTests/http/tests/xmlhttprequest/workers/resources/xmlhttprequest-timeout-override.js

Issue 273993002: Allow XHR timeout attribute to be overridden after send(), per spec (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add CORS preflight-failure test case Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/xmlhttprequest/workers/resources/xmlhttprequest-timeout-override.js
diff --git a/LayoutTests/http/tests/xmlhttprequest/workers/resources/upload-onprogress-event.js b/LayoutTests/http/tests/xmlhttprequest/workers/resources/xmlhttprequest-timeout-override.js
similarity index 67%
copy from LayoutTests/http/tests/xmlhttprequest/workers/resources/upload-onprogress-event.js
copy to LayoutTests/http/tests/xmlhttprequest/workers/resources/xmlhttprequest-timeout-override.js
index d070e0fedf53cec2eb949fb4e904db7ef42f1441..cbaf461ce104d466987e32c4f2c8bdac76fba9cb 100644
--- a/LayoutTests/http/tests/xmlhttprequest/workers/resources/upload-onprogress-event.js
+++ b/LayoutTests/http/tests/xmlhttprequest/workers/resources/xmlhttprequest-timeout-override.js
@@ -1,7 +1,7 @@
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
- }
+}
var console_messages = document.createElement("ul");
document.body.appendChild(console_messages);
@@ -14,15 +14,16 @@ function log(message)
}
var progress_ticks = 0;
-var worker = createWorker('resources/upload-onprogress-worker.js');
+var worker = createWorker('resources/xmlhttprequest-timeout-override-worker.js');
+var messages = [];
worker.onmessage = function(evt)
{
if (/log .+/.test(evt.data)) {
- log(evt.data.substr(4));
- } else if (/tick .+/.test(evt.data)) {
- progress_ticks++;
+ var msg = evt.data.substr(4);
+ messages.push(msg);
+ log(msg);
} else if (/DONE/.test(evt.data)) {
- log(progress_ticks >= 1 ? "PASS" : "FAIL");
+ log(messages.length === 1 && messages[0] === "timeout" ? "PASS" : "FAIL");
if (window.testRunner)
testRunner.notifyDone();
}

Powered by Google App Engine
This is Rietveld 408576698