mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision 000905d008db2538360020335bc2dbba16d322b5.
This commit is contained in:
parent
53d2432c90
commit
2d49203b9c
100 changed files with 3807 additions and 201 deletions
|
@ -2,14 +2,14 @@ if (this.document === undefined)
|
|||
importScripts("xmlhttprequest-timeout.js");
|
||||
/*
|
||||
This sets up three requests:
|
||||
The first request will only be open()ed, not aborted, timeout will be 400 but will never triggered because send() isn't called.
|
||||
After a 1 second delay, the test asserts that no load/error/timeout/abort events fired
|
||||
The first request will only be open()ed, not aborted, timeout will be TIME_REGULAR_TIMEOUT but will never triggered because send() isn't called.
|
||||
After TIME_NORMAL_LOAD, the test asserts that no load/error/timeout/abort events fired
|
||||
|
||||
Second request will be aborted immediately after send(), test asserts that abort fired
|
||||
|
||||
Third request is set up to call abort() after a 1 second delay, but it also has a 400ms timeout. Asserts that timeout fired.
|
||||
(abort() is called 600ms later and should not fire an abort event per spec. This is untested!)
|
||||
Third request is set up to call abort() after TIME_NORMAL_LOAD, but it also has a TIME_REGULAR_TIMEOUT timeout. Asserts that timeout fired.
|
||||
(abort() is called later and should not fire an abort event per spec. This is untested!)
|
||||
*/
|
||||
runTestRequests([ new AbortedRequest(false),
|
||||
new AbortedRequest(true, -1),
|
||||
new AbortedRequest(true, TIME_NORMAL_LOAD) ]);
|
||||
new AbortedRequest(true, -1),
|
||||
new AbortedRequest(true, TIME_NORMAL_LOAD) ]);
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
This test sets up two requests:
|
||||
This test sets up two requests:
|
||||
one that gets abort()ed from a 0ms timeout (0ms will obviously be clamped to whatever the implementation's minimal value is), asserts abort event fires
|
||||
one that will be aborted after 200ms (TIME_DELAY), (with a timeout at 400ms) asserts abort event fires. Does not assert that the timeout event does *not* fire.
|
||||
one that will be aborted after TIME_DELAY, (with a timeout at TIME_REGULAR_TIMEOUT) asserts abort event fires. Does not assert that the timeout event does *not* fire.
|
||||
*/
|
||||
|
||||
runTestRequests([ new AbortedRequest(true, 0),
|
||||
new AbortedRequest(true, TIME_DELAY) ]);
|
||||
new AbortedRequest(true, TIME_DELAY) ]);
|
||||
|
|
|
@ -2,10 +2,10 @@ if (this.document === undefined)
|
|||
importScripts("xmlhttprequest-timeout.js");
|
||||
/*
|
||||
Sets up three requests to a resource that will take 0.6 seconds to load:
|
||||
1) timeout first set to 1000ms, after 400ms timeout is set to 0, asserts load fires
|
||||
2) timeout first set to 1000ms, after 200ms timeout is set to 400, asserts load fires (race condition..?!?)
|
||||
3) timeout first set to 0, after 400ms it is set to 1000, asserts load fires
|
||||
1) timeout first set to TIME_NORMAL_LOAD, after TIME_REGULAR_TIMEOUT timeout is set to 0, asserts load fires
|
||||
2) timeout first set to TIME_NORMAL_LOAD, after TIME_DELAY timeout is set to TIME_REGULAR_TIMEOUT, asserts load fires (race condition..?!?)
|
||||
3) timeout first set to 0, after TIME_REGULAR_TIMEOUT it is set to TIME_REGULAR_TIMEOUT * 10, asserts load fires
|
||||
*/
|
||||
runTestRequests([ new RequestTracker(true, "timeout disabled after initially set", TIME_NORMAL_LOAD, TIME_REGULAR_TIMEOUT, 0),
|
||||
new RequestTracker(true, "timeout overrides load after a delay", TIME_NORMAL_LOAD, TIME_DELAY, TIME_REGULAR_TIMEOUT),
|
||||
new RequestTracker(true, "timeout enabled after initially disabled", 0, TIME_REGULAR_TIMEOUT, TIME_NORMAL_LOAD * 10) ]);
|
||||
new RequestTracker(true, "timeout overrides load after a delay", TIME_NORMAL_LOAD, TIME_DELAY, TIME_REGULAR_TIMEOUT),
|
||||
new RequestTracker(true, "timeout enabled after initially disabled", 0, TIME_REGULAR_TIMEOUT, TIME_NORMAL_LOAD * 10) ]);
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
if (this.document === undefined)
|
||||
importScripts("xmlhttprequest-timeout.js");
|
||||
/*
|
||||
Starts three requests:
|
||||
1) XHR to resource which will take a least 600ms with timeout initially set to 1000ms. After 800ms timeout is supposedly reset to 200ms,
|
||||
but the resource should have finished loading already. Asserts "load" fires.
|
||||
2) XHR with initial timeout set to 1000, after 400ms sets timeout to 300ms. Asserts "timeout" fires.
|
||||
(Originally new value was 200ms. Race condition-y. Setting the new timeout to 300ms would be a better test of the "measured from start of fetching" requirement.)
|
||||
3) XHR with initial timeout set to 200, after 400ms sets timeout to 500ms. Asserts "timeout" fires (the change happens when timeout already fired and the request is done).
|
||||
Starts three requests:
|
||||
1) XHR to resource which will take a least TIME_XHR_LOAD ms with timeout initially set to TIME_NORMAL_LOAD ms. After TIME_LATE_TIMEOUT ms timeout is supposedly reset to TIME_DELAY ms,
|
||||
but the resource should have finished loading already. Asserts "load" fires.
|
||||
2) XHR with initial timeout set to TIME_NORMAL_LOAD, after TIME_REGULAR_TIMEOUT sets timeout to TIME_DELAY+100. Asserts "timeout" fires.
|
||||
3) XHR with initial timeout set to TIME_DELAY, after TIME_REGULAR_TIMEOUT sets timeout to 500ms. Asserts "timeout" fires (the change happens when timeout already fired and the request is done).
|
||||
*/
|
||||
runTestRequests([ new RequestTracker(true, "timeout set to expiring value after load fires", TIME_NORMAL_LOAD, TIME_LATE_TIMEOUT, TIME_DELAY),
|
||||
new RequestTracker(true, "timeout set to expired value before load fires", TIME_NORMAL_LOAD, TIME_REGULAR_TIMEOUT, TIME_DELAY+100),
|
||||
new RequestTracker(true, "timeout set to non-expiring value after timeout fires", TIME_DELAY, TIME_REGULAR_TIMEOUT, 500) ]);
|
||||
new RequestTracker(true, "timeout set to expired value before load fires", TIME_NORMAL_LOAD, TIME_REGULAR_TIMEOUT, TIME_DELAY+100),
|
||||
new RequestTracker(true, "timeout set to non-expiring value after timeout fires", TIME_DELAY, TIME_REGULAR_TIMEOUT, 500) ]);
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
function testResultCallbackHandler(event) {
|
||||
if (event.data == "done") {
|
||||
done();
|
||||
|
@ -16,5 +17,5 @@ function testResultCallbackHandler(event) {
|
|||
window.addEventListener("message", testResultCallbackHandler);
|
||||
|
||||
// Setting up testharness.js
|
||||
setup({ explicit_done: true, timeout: 30 * 1000 });
|
||||
setup({ explicit_done: true });
|
||||
|
||||
|
|
|
@ -11,12 +11,12 @@
|
|||
request handlers.
|
||||
*/
|
||||
|
||||
var TIME_NORMAL_LOAD = 1000;
|
||||
var TIME_LATE_TIMEOUT = 800;
|
||||
var TIME_XHR_LOAD = 600;
|
||||
var TIME_REGULAR_TIMEOUT = 400;
|
||||
var TIME_SYNC_TIMEOUT = 200;
|
||||
var TIME_DELAY = 200;
|
||||
var TIME_NORMAL_LOAD = 5000;
|
||||
var TIME_LATE_TIMEOUT = 4000;
|
||||
var TIME_XHR_LOAD = 3000;
|
||||
var TIME_REGULAR_TIMEOUT = 2000;
|
||||
var TIME_SYNC_TIMEOUT = 1000;
|
||||
var TIME_DELAY = 1000;
|
||||
|
||||
/*
|
||||
* This should point to a resource that responds with a text/plain resource after a delay of TIME_XHR_LOAD milliseconds.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue