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

Side by Side Diff: LayoutTests/http/tests/xmlhttprequest/workers/resources/xmlhttprequest-timeout-override-worker.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: Rebase again Created 6 years, 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 importScripts("worker-pre.js");
2
3 function log(message) {
4 postMessage("log " + message);
5 }
6
7 function done() {
8 postMessage("DONE");
9 }
10
11 function eventHandler(e) {
12 log(e.type);
13 done();
14 }
15
16 function init() {
17 try {
18 var xhr = new XMLHttpRequest();
19 xhr.ontimeout = eventHandler;
20 xhr.onabort = eventHandler;
21 xhr.onerror = eventHandler;
22 xhr.onload = eventHandler;
23
24 xhr.timeout = 100000;
25 xhr.open("GET", "../../../resources/load-and-stall.php?name=../resources /test.mp4&stallAt=0&stallFor=1000&mimeType=video/mp4", true);
26
27 // Defer overriding timeout
28 setTimeout(function() {
29 xhr.timeout = 400;
30 }, 200);
31
32 setTimeout(function() {
33 xhr.abort();
34 }, 1000);
35
36 xhr.send();
37 } catch (e) {
38 log(e);
39 done();
40 }
41 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698