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

Side by Side Diff: LayoutTests/http/tests/xmlhttprequest/ontimeout-event-override.html

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: Created 6 years, 7 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
1 <!doctype html> 1 <!doctype html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../resources/testharness.js"></script> 4 <script src="../resources/testharness.js"></script>
5 <script src="../resources/testharnessreport.js"></script> 5 <script src="../resources/testharnessreport.js"></script>
6 </head> 6 </head>
7 <body> 7 <body>
8 <p> Verify that a timeout ProgressEvent is dispatched and have the expected valu es.</p> 8 <p> Verify that a timeout ProgressEvent is dispatched and have the expected valu es.</p>
9 <div id="log"></div> 9 <div id="log"></div>
10 <script type="text/javascript"> 10 <script type="text/javascript">
(...skipping 19 matching lines...) Expand all
30 testOnTimeoutEvent.done(); 30 testOnTimeoutEvent.done();
31 } 31 }
32 32
33 var testOnTimeoutEvent = async_test("Check that 'timeout' events are delivered a nd have expected values."); 33 var testOnTimeoutEvent = async_test("Check that 'timeout' events are delivered a nd have expected values.");
34 testOnTimeoutEvent.step(function () { 34 testOnTimeoutEvent.step(function () {
35 var xhr = new XMLHttpRequest(); 35 var xhr = new XMLHttpRequest();
36 xhr.ontimeout = testOnTimeoutEvent.step_func(timeoutHandler); 36 xhr.ontimeout = testOnTimeoutEvent.step_func(timeoutHandler);
37 xhr.onabort = testOnTimeoutEvent.step_func(unexpectedProgressEvent); 37 xhr.onabort = testOnTimeoutEvent.step_func(unexpectedProgressEvent);
38 xhr.onerror = testOnTimeoutEvent.step_func(unexpectedProgressEvent); 38 xhr.onerror = testOnTimeoutEvent.step_func(unexpectedProgressEvent);
39 xhr.onload = testOnTimeoutEvent.step_func(unexpectedProgressEvent); 39 xhr.onload = testOnTimeoutEvent.step_func(unexpectedProgressEvent);
40 xhr.timeout = 30; 40 xhr.timeout = 1000;
tyoshino (SeeGerritForStatus) 2014/05/12 09:21:17 how about using value clearly greater than one pas
41 xhr.open("GET", "/resources/load-and-stall.php?name=../resources/test.mp4&st allAt=100&stallFor=10000&mimeType=video/mp4", true); 41 xhr.open("GET", "/resources/load-and-stall.php?name=../resources/test.mp4&st allAt=0&stallFor=1000&mimeType=video/mp4", true);
42 xhr.send(); 42 xhr.send();
43 // Defer overriding timeout
44 setTimeout(function() {
45 xhr.timeout = 400;
46 }, 200);
43 }); 47 });
44 </script> 48 </script>
45 </body> 49 </body>
46 </html> 50 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698