forked from web-platform-tests/wpt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request web-platform-tests#91 from tmpsantos/new_xhr_tests
Adding Intel XHR timeout tests.
- Loading branch information
Showing
24 changed files
with
676 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>XHR2 Timeout Property Tests</title> | ||
<link rel="help" href="http://www.w3.org/TR/XMLHttpRequest/#timeout-error" /> | ||
<link rel="stylesheet" href="/resources/testharness.css" /> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="xmlhttprequest-timeout.js"></script> | ||
<script src="xmlhttprequest-timeout-runner.js"></script> | ||
</head> | ||
<body> | ||
<h1>Description</h1> | ||
<p>This test validates that the XHR2 timeout property behaves as expected in async cases in document (i.e. non-worker) context.</p> | ||
<div id="log"></div> | ||
<script src="xmlhttprequest-timeout-aborted.js" type="text/javascript"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
if (this.document === undefined) | ||
importScripts("xmlhttprequest-timeout.js"); | ||
|
||
runTestRequests([ new AbortedRequest(false), | ||
new AbortedRequest(true, -1), | ||
new AbortedRequest(true, TIME_NORMAL_LOAD) ]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>XHR2 Timeout Property Tests</title> | ||
<link rel="help" href="http://www.w3.org/TR/XMLHttpRequest/#timeout-error" /> | ||
<link rel="stylesheet" href="/resources/testharness.css" /> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="xmlhttprequest-timeout.js"></script> | ||
<script src="xmlhttprequest-timeout-runner.js"></script> | ||
</head> | ||
<body> | ||
<h1>Description</h1> | ||
<p>This test validates that the XHR2 timeout property behaves as expected in async cases in document (i.e. non-worker) context.</p> | ||
<div id="log"></div> | ||
<script src="xmlhttprequest-timeout-abortedonmain.js" type="text/javascript"></script> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
runTestRequests([ new AbortedRequest(true, 0), | ||
new AbortedRequest(true, TIME_DELAY) ]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>XHR2 Timeout Property Tests</title> | ||
<link rel="help" href="http://www.w3.org/TR/XMLHttpRequest/#timeout-error" /> | ||
<link rel="stylesheet" href="/resources/testharness.css" /> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="xmlhttprequest-timeout.js"></script> | ||
<script src="xmlhttprequest-timeout-runner.js"></script> | ||
</head> | ||
<body> | ||
<h1>Description</h1> | ||
<p>This test validates that the XHR2 timeout property behaves as expected in async cases in document (i.e. non-worker) context.</p> | ||
<div id="log"></div> | ||
<script src="xmlhttprequest-timeout-overrides.js"></script> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
if (this.document === undefined) | ||
importScripts("xmlhttprequest-timeout.js"); | ||
|
||
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) ]); |
19 changes: 19 additions & 0 deletions
19
XMLHttpRequest/xmlhttprequest-timeout-overridesexpires.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>XHR2 Timeout Property Tests</title> | ||
<link rel="help" href="http://www.w3.org/TR/XMLHttpRequest/#timeout-error" /> | ||
<link rel="stylesheet" href="/resources/testharness.css" /> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="xmlhttprequest-timeout.js"></script> | ||
<script src="xmlhttprequest-timeout-runner.js"></script> | ||
</head> | ||
<body> | ||
<h1>Description</h1> | ||
<p>This test validates that the XHR2 timeout property behaves as expected in async cases in document (i.e. non-worker) context.</p> | ||
<div id="log"></div> | ||
<script src="xmlhttprequest-timeout-overridesexpires.js" type="text/javascript"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
if (this.document === undefined) | ||
importScripts("xmlhttprequest-timeout.js"); | ||
|
||
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), | ||
new RequestTracker(true, "timeout set to non-expiring value after timeout fires", TIME_DELAY, TIME_REGULAR_TIMEOUT, TIME_NORMAL_LOAD) ]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
function testResultCallbackHandler(event) { | ||
if (event.data == "done") { | ||
done(); | ||
return; | ||
} | ||
if (event.data.type == "is") { | ||
test(function() { assert_equals(event.data.got, event.data.expected, event.data.msg); }); | ||
return; | ||
} | ||
if (event.data.type == "ok") { | ||
test(function() { assert_true(event.data.bool, event.data.msg); }); | ||
return; | ||
} | ||
} | ||
|
||
window.addEventListener("message", testResultCallbackHandler); | ||
|
||
// Setting up testharness.js | ||
setup({ explicit_done: true, timeout: 30 * 1000 }); | ||
|
||
// Abort test execution if an individual test case fails. | ||
add_result_callback(function (t) { | ||
if (t.status == t.FAIL) | ||
done(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>XHR2 Timeout Property Tests</title> | ||
<link rel="help" href="http://www.w3.org/TR/XMLHttpRequest/#timeout-error" /> | ||
<link rel="stylesheet" href="/resources/testharness.css" /> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="xmlhttprequest-timeout.js"></script> | ||
<script src="xmlhttprequest-timeout-runner.js"></script> | ||
</head> | ||
<body> | ||
<h1>Description</h1> | ||
<p>This test validates that the XHR2 timeout property behaves as expected in async cases in document (i.e. non-worker) context.</p> | ||
<div id="log"></div> | ||
<script src="xmlhttprequest-timeout-simple.js"></script> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
if (this.document === undefined) | ||
importScripts("xmlhttprequest-timeout.js"); | ||
|
||
runTestRequests([ new RequestTracker(true, "no time out scheduled, load fires normally", 0), | ||
new RequestTracker(true, "load fires normally", TIME_NORMAL_LOAD), | ||
new RequestTracker(true, "timeout hit before load", TIME_REGULAR_TIMEOUT) ]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>XHR2 Timeout Property Tests</title> | ||
<link rel="help" href="http://www.w3.org/TR/XMLHttpRequest/#timeout-error" /> | ||
<link rel="stylesheet" href="/resources/testharness.css" /> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="xmlhttprequest-timeout.js"></script> | ||
<script src="xmlhttprequest-timeout-runner.js"></script> | ||
</head> | ||
<body> | ||
<h1>Description</h1> | ||
<p>This test validates that the XHR2 timeout property behaves as expected in async cases in document (i.e. non-worker) context.</p> | ||
<div id="log"></div> | ||
<script src="xmlhttprequest-timeout-synconmain.js" type="text/javascript"></script> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
runTestRequests([ SyncRequestSettingTimeoutAfterOpen, | ||
SyncRequestSettingTimeoutBeforeOpen ]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
if (this.document === undefined) | ||
importScripts("xmlhttprequest-timeout.js"); | ||
|
||
runTestRequests([ new RequestTracker(false, "no time out scheduled, load fires normally", 0), | ||
new RequestTracker(false, "load fires normally", TIME_NORMAL_LOAD), | ||
new RequestTracker(false, "timeout hit before load", TIME_REGULAR_TIMEOUT) ]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>XHR2 Timeout Property Tests</title> | ||
<link rel="help" href="http://www.w3.org/TR/XMLHttpRequest/#timeout-error" /> | ||
<link rel="stylesheet" href="/resources/testharness.css" /> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="xmlhttprequest-timeout.js"></script> | ||
<script src="xmlhttprequest-timeout-runner.js"></script> | ||
</head> | ||
<body> | ||
<h1>Description</h1> | ||
<p>This test validates that the XHR2 timeout property behaves as expected in async cases in document (i.e. non-worker) context.</p> | ||
<div id="log"></div> | ||
<script src="xmlhttprequest-timeout-twice.js" type="text/javascript"></script> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
if (this.document === undefined) | ||
importScripts("xmlhttprequest-timeout.js"); | ||
|
||
runTestRequests([ new RequestTracker(true, "load fires normally with no timeout set, twice", 0, TIME_REGULAR_TIMEOUT, 0), | ||
new RequestTracker(true, "load fires normally with same timeout set twice", TIME_NORMAL_LOAD, TIME_REGULAR_TIMEOUT, TIME_NORMAL_LOAD), | ||
new RequestTracker(true, "timeout fires normally with same timeout set twice", TIME_REGULAR_TIMEOUT, TIME_DELAY, TIME_REGULAR_TIMEOUT) ]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>XHR2 Timeout Property Tests in Worker</title> | ||
<link rel="help" href="http://www.w3.org/TR/XMLHttpRequest/#timeout-error" /> | ||
<link rel="stylesheet" href="/resources/testharness.css" /> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="xmlhttprequest-timeout-runner.js"></script> | ||
</head> | ||
<body> | ||
<h1>Description</h1> | ||
<p>This test validates that the XHR2 timeout property behaves as expected in in a worker context.</p> | ||
<div id="log"></div> | ||
<script type="text/javascript"> | ||
var worker = new Worker("xmlhttprequest-timeout-aborted.js"); | ||
worker.addEventListener("message", testResultCallbackHandler); | ||
</script> | ||
</body> | ||
</html> |
21 changes: 21 additions & 0 deletions
21
XMLHttpRequest/xmlhttprequest-timeout-worker-overrides.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>XHR2 Timeout Property Tests in Worker</title> | ||
<link rel="help" href="http://www.w3.org/TR/XMLHttpRequest/#timeout-error" /> | ||
<link rel="stylesheet" href="/resources/testharness.css" /> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="xmlhttprequest-timeout-runner.js"></script> | ||
</head> | ||
<body> | ||
<h1>Description</h1> | ||
<p>This test validates that the XHR2 timeout property behaves as expected in in a worker context.</p> | ||
<div id="log"></div> | ||
<script type="text/javascript"> | ||
var worker = new Worker("xmlhttprequest-timeout-overrides.js"); | ||
worker.addEventListener("message", testResultCallbackHandler); | ||
</script> | ||
</body> | ||
</html> |
21 changes: 21 additions & 0 deletions
21
XMLHttpRequest/xmlhttprequest-timeout-worker-overridesexpires.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>XHR2 Timeout Property Tests in Worker</title> | ||
<link rel="help" href="http://www.w3.org/TR/XMLHttpRequest/#timeout-error" /> | ||
<link rel="stylesheet" href="/resources/testharness.css" /> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="xmlhttprequest-timeout-runner.js"></script> | ||
</head> | ||
<body> | ||
<h1>Description</h1> | ||
<p>This test validates that the XHR2 timeout property behaves as expected in in a worker context.</p> | ||
<div id="log"></div> | ||
<script type="text/javascript"> | ||
var worker = new Worker("xmlhttprequest-timeout-overridesexpires.js"); | ||
worker.addEventListener("message", testResultCallbackHandler); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>XHR2 Timeout Property Tests in Worker</title> | ||
<link rel="help" href="http://www.w3.org/TR/XMLHttpRequest/#timeout-error" /> | ||
<link rel="stylesheet" href="/resources/testharness.css" /> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="xmlhttprequest-timeout-runner.js"></script> | ||
</head> | ||
<body> | ||
<h1>Description</h1> | ||
<p>This test validates that the XHR2 timeout property behaves as expected in in a worker context.</p> | ||
<div id="log"></div> | ||
<script type="text/javascript"> | ||
var worker = new Worker("xmlhttprequest-timeout-simple.js"); | ||
worker.onmessage = testResultCallbackHandler; | ||
</script> | ||
</body> | ||
</html> | ||
|
21 changes: 21 additions & 0 deletions
21
XMLHttpRequest/xmlhttprequest-timeout-worker-synconworker.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>XHR2 Timeout Property Tests in Worker</title> | ||
<link rel="help" href="http://www.w3.org/TR/XMLHttpRequest/#timeout-error" /> | ||
<link rel="stylesheet" href="/resources/testharness.css" /> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="xmlhttprequest-timeout-runner.js"></script> | ||
</head> | ||
<body> | ||
<h1>Description</h1> | ||
<p>This test validates that the XHR2 timeout property behaves as expected in in a worker context.</p> | ||
<div id="log"></div> | ||
<script type="text/javascript"> | ||
var worker = new Worker("xmlhttprequest-timeout-synconworker.js"); | ||
worker.addEventListener("message", testResultCallbackHandler); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>XHR2 Timeout Property Tests in Worker</title> | ||
<link rel="help" href="http://www.w3.org/TR/XMLHttpRequest/#timeout-error" /> | ||
<link rel="stylesheet" href="/resources/testharness.css" /> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="xmlhttprequest-timeout-runner.js"></script> | ||
</head> | ||
<body> | ||
<h1>Description</h1> | ||
<p>This test validates that the XHR2 timeout property behaves as expected in in a worker context.</p> | ||
<div id="log"></div> | ||
<script type="text/javascript"> | ||
var worker = new Worker("xmlhttprequest-timeout-twice.js"); | ||
worker.addEventListener("message", testResultCallbackHandler); | ||
</script> | ||
</body> | ||
</html> | ||
|
Oops, something went wrong.