Diff
Modified: trunk/LayoutTests/ChangeLog (224580 => 224581)
--- trunk/LayoutTests/ChangeLog 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/ChangeLog 2017-11-08 16:00:18 UTC (rev 224581)
@@ -1,3 +1,12 @@
+2017-11-08 Ms2ger <[email protected]>
+
+ Update XMLHttpRequest tests.
+ https://bugs.webkit.org/show_bug.cgi?id=179421
+
+ Reviewed by Sam Weinig.
+
+ * TestExpectations: removed flaky expectation: the test was fixed upstream.
+
2017-11-07 Ryan Haddad <[email protected]>
Update TestExpectations for slow WPT encoding LayoutTests.
Modified: trunk/LayoutTests/TestExpectations (224580 => 224581)
--- trunk/LayoutTests/TestExpectations 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/TestExpectations 2017-11-08 16:00:18 UTC (rev 224581)
@@ -1381,7 +1381,6 @@
webkit.org/b/168175 imported/w3c/web-platform-tests/html/browsers/offline/browser-state/navigator_online_online.html [ Pass Failure ]
webkit.org/b/169264 imported/w3c/web-platform-tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-navigation-samedoc.html [ Failure ]
-imported/w3c/web-platform-tests/XMLHttpRequest/open-url-redirected-worker-origin.htm [ Failure Pass ]
imported/w3c/web-platform-tests/cssom/MediaList.html [ Failure ]
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/document-adopt-base-url.html [ ImageOnlyFailure ]
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2017-11-08 16:00:18 UTC (rev 224581)
@@ -1,3 +1,59 @@
+2017-11-08 Ms2ger <[email protected]>
+
+ Update XMLHttpRequest tests.
+ https://bugs.webkit.org/show_bug.cgi?id=179421
+
+ Reviewed by Sam Weinig.
+
+ * resources/import-expectations.json: enabled some more tests
+ * web-platform-tests/XMLHttpRequest/abort-during-done.htm:
+ * web-platform-tests/XMLHttpRequest/abort-during-headers-received.htm:
+ * web-platform-tests/XMLHttpRequest/abort-during-loading.htm:
+ * web-platform-tests/XMLHttpRequest/open-after-abort.htm:
+ * web-platform-tests/XMLHttpRequest/open-url-multi-window-2-expected.txt:
+ * web-platform-tests/XMLHttpRequest/open-url-multi-window-2.htm:
+ * web-platform-tests/XMLHttpRequest/open-url-multi-window-3-expected.txt:
+ * web-platform-tests/XMLHttpRequest/open-url-multi-window-3.htm:
+ * web-platform-tests/XMLHttpRequest/open-url-multi-window-4.htm:
+ * web-platform-tests/XMLHttpRequest/open-url-multi-window-6.htm:
+ * web-platform-tests/XMLHttpRequest/open-url-redirected-worker-origin-expected.txt:
+ * web-platform-tests/XMLHttpRequest/open-url-redirected-worker-origin.htm:
+ * web-platform-tests/XMLHttpRequest/open-url-worker-origin-expected.txt: Added.
+ * web-platform-tests/XMLHttpRequest/open-url-worker-origin.htm: Added.
+ * web-platform-tests/XMLHttpRequest/overridemimetype-open-state-force-xml.htm:
+ * web-platform-tests/XMLHttpRequest/resources/workerxhr-origin-referrer.js:
+ * web-platform-tests/XMLHttpRequest/resources/workerxhr-simple.js:
+ * web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout-simple.js:
+ * web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout-synconmain.js:
+ * web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout-synconworker.js:
+ * web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout-twice.js:
+ * web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout.js:
+ * web-platform-tests/XMLHttpRequest/responsedocument-decoding.htm:
+ * web-platform-tests/XMLHttpRequest/send-authentication-basic-cors-expected.txt: Added.
+ * web-platform-tests/XMLHttpRequest/send-authentication-basic-cors.htm: Added.
+ * web-platform-tests/XMLHttpRequest/send-authentication-basic-repeat-no-args-expected.txt: Added.
+ * web-platform-tests/XMLHttpRequest/send-authentication-basic-repeat-no-args.htm: Added.
+ * web-platform-tests/XMLHttpRequest/send-authentication-basic-setrequestheader.htm: Added.
+ * web-platform-tests/XMLHttpRequest/send-authentication-basic.htm: Added.
+ * web-platform-tests/XMLHttpRequest/send-authentication-competing-names-passwords-expected.txt: Added.
+ * web-platform-tests/XMLHttpRequest/send-authentication-competing-names-passwords.htm: Added.
+ * web-platform-tests/XMLHttpRequest/send-entity-body-basic-expected.txt: Added.
+ * web-platform-tests/XMLHttpRequest/send-entity-body-basic.htm: Added.
+ * web-platform-tests/XMLHttpRequest/send-entity-body-document-expected.txt:
+ * web-platform-tests/XMLHttpRequest/send-entity-body-document.htm:
+ * web-platform-tests/XMLHttpRequest/send-entity-body-get-head-async.htm:
+ * web-platform-tests/XMLHttpRequest/send-entity-body-get-head.htm:
+ * web-platform-tests/XMLHttpRequest/send-network-error-async-events.sub-expected.txt: Added.
+ * web-platform-tests/XMLHttpRequest/send-network-error-async-events.sub.htm: Added.
+ * web-platform-tests/XMLHttpRequest/send-redirect-infinite.htm:
+ * web-platform-tests/XMLHttpRequest/send-redirect-no-location.htm:
+ * web-platform-tests/XMLHttpRequest/send-redirect-post-upload.htm:
+ * web-platform-tests/XMLHttpRequest/setrequestheader-after-send.htm:
+ * web-platform-tests/XMLHttpRequest/setrequestheader-before-open.htm:
+ * web-platform-tests/XMLHttpRequest/w3c-import.log:
+ * web-platform-tests/XMLHttpRequest/xmlhttprequest-timeout-reused.html:
+ * web-platform-tests/XMLHttpRequest/xmlhttprequest-unsent.htm:
+
2017-11-07 Brady Eidson <[email protected]>
Implement "UpdateWorkerState" and use it
Modified: trunk/LayoutTests/imported/w3c/resources/import-expectations.json (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/resources/import-expectations.json 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/resources/import-expectations.json 2017-11-08 16:00:18 UTC (rev 224581)
@@ -15,21 +15,11 @@
"web-platform-tests/XMLHttpRequest": "import",
"web-platform-tests/XMLHttpRequest/abort-after-stop.htm": "skip",
"web-platform-tests/XMLHttpRequest/event-error-order.sub.html": "skip",
- "web-platform-tests/XMLHttpRequest/event-error.html": "skip",
"web-platform-tests/XMLHttpRequest/event-timeout-order.htm": "skip",
- "web-platform-tests/XMLHttpRequest/event-upload-progress-crossorigin.sub.htm": "skip",
- "web-platform-tests/XMLHttpRequest/open-url-worker-origin.htm": "skip",
"web-platform-tests/XMLHttpRequest/preserve-ua-header-on-redirect.htm": "skip",
"web-platform-tests/XMLHttpRequest/send-after-setting-document-domain.htm": "skip",
"web-platform-tests/XMLHttpRequest/send-authentication-basic-cors-not-enabled.htm": "skip",
- "web-platform-tests/XMLHttpRequest/send-authentication-basic-cors.htm": "skip",
- "web-platform-tests/XMLHttpRequest/send-authentication-basic-repeat-no-args.htm": "skip",
"web-platform-tests/XMLHttpRequest/send-authentication-basic-setrequestheader-existing-session.htm": "skip",
- "web-platform-tests/XMLHttpRequest/send-authentication-basic-setrequestheader.htm": "skip",
- "web-platform-tests/XMLHttpRequest/send-authentication-basic.htm": "skip",
- "web-platform-tests/XMLHttpRequest/send-authentication-competing-names-passwords.htm": "skip",
- "web-platform-tests/XMLHttpRequest/send-entity-body-basic.htm": "skip",
- "web-platform-tests/XMLHttpRequest/send-network-error-async-events.sub.htm": "skip",
"web-platform-tests/accelerometer": "skip",
"web-platform-tests/ambient-light": "skip",
"web-platform-tests/animation-timing": "skip",
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-during-done.htm (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-during-done.htm 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-during-done.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -76,7 +76,7 @@
assert_equals(client.statusText, "")
assert_equals(client.responseXML, null)
assert_equals(client.getAllResponseHeaders(), "")
- setTimeout(function() {
+ test.step_timeout(function() {
assert_array_equals(result, expected)
test.done();
}, 100); // wait a bit in case XHR timeout causes spurious event
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-during-headers-received.htm (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-during-headers-received.htm 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-during-headers-received.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -40,7 +40,7 @@
assert_equals(client.statusText, "")
assert_equals(client.responseXML, null)
assert_equals(client.getAllResponseHeaders(), "")
- setTimeout(function() {
+ test.step_timeout(function() {
assert_array_equals(result, expected)
test.done();
}, 100); // wait a bit in case XHR timeout causes spurious event
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-during-loading.htm (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-during-loading.htm 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-during-loading.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -40,7 +40,7 @@
assert_equals(client.statusText, "")
assert_equals(client.responseXML, null)
assert_equals(client.getAllResponseHeaders(), "")
- setTimeout(function() {
+ test.step_timeout(function() {
assert_array_equals(result, expected)
test.done();
}, 100); // wait a bit in case XHR timeout causes spurious event
@@ -51,4 +51,3 @@
</script>
</body>
</html>
-
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-after-abort.htm (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-after-abort.htm 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-after-abort.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -13,7 +13,7 @@
test.step(function() {
var client = new XMLHttpRequest(),
result = [],
- expected = [1, 4, 1] // open() -> 1,
+ expected = [1, 4, 1] // open() -> 1,
// abort() -> 4, open() -> 1
client._onreadystatechange_ = function() {
test.step(function() {
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-2-expected.txt (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-2-expected.txt 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-2-expected.txt 2017-11-08 16:00:18 UTC (rev 224581)
@@ -1,5 +1,5 @@
-FAIL XMLHttpRequest: open() resolving URLs (multi-Window; 2; evil) assert_throws: open() when associated document's IFRAME is removed function "function () {
- client.open("GET", "folder.txt")
+FAIL XMLHttpRequest: open() resolving URLs (multi-Window; 2; evil) assert_throws: open() when associated document's IFRAME is removed function "function () {
+ client.open("GET", "folder.txt")
}" did not throw
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-2.htm (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-2.htm 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-2.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -13,8 +13,8 @@
test(function() {
var client = new self[0].XMLHttpRequest()
document.body.removeChild(document.getElementsByTagName("iframe")[0])
- assert_throws("InvalidStateError", function() {
- client.open("GET", "folder.txt")
+ assert_throws("InvalidStateError", function() {
+ client.open("GET", "folder.txt")
}, "open() when associated document's IFRAME is removed")
})
}
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-3-expected.txt (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-3-expected.txt 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-3-expected.txt 2017-11-08 16:00:18 UTC (rev 224581)
@@ -1,5 +1,5 @@
-FAIL XMLHttpRequest: open() resolving URLs (multi-Window; 3; evil) assert_throws: send() when associated document's IFRAME is removed function "function () {
+FAIL XMLHttpRequest: open() resolving URLs (multi-Window; 3; evil) assert_throws: send() when associated document's IFRAME is removed function "function () {
client.send(null)
}" did not throw
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-3.htm (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-3.htm 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-3.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -13,7 +13,7 @@
var client = new self[0].XMLHttpRequest()
client.open("GET", "folder.txt")
document.body.removeChild(document.getElementsByTagName("iframe")[0])
- assert_throws("InvalidStateError", function() {
+ assert_throws("InvalidStateError", function() {
client.send(null)
}, "send() when associated document's IFRAME is removed")
})
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-4.htm (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-4.htm 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-4.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -11,7 +11,7 @@
/*
It's unclear what the pass condition should be for this test.
Implementations:
- Firefox, Opera (Presto): terminate request with no further events when IFRAME is removed.
+ Firefox, Opera (Presto): terminate request with no further events when IFRAME is removed.
Chrome: completes request to readyState=4 but responseText is "" so it's pretty much terminated with an extra event for "DONE" state
Pass condition is now according to my suggested spec text in https://github.com/whatwg/xhr/pull/3 , if that's not accepted we'll have to amend this test
*/
@@ -20,7 +20,7 @@
test.step(function() {
var hasErrorEvent = false
var client = new self[0].XMLHttpRequest()
- client._onreadystatechange_ = function() {
+ client._onreadystatechange_ = function() {
test.step(function() {
if(client.readyState == 4) {
assert_equals(client.responseText, "", "responseText is empty on inactive document error condition")
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-6.htm (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-6.htm 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-6.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -22,7 +22,7 @@
ifr._onload_ = function() {
// Again, do things async so we're not doing loads from inside
// load events.
- setTimeout(function() {
+ test.step_timeout(function() {
client = new ifr.contentWindow.XMLHttpRequest();
count++;
// Important to do a normal navigation, not a reload.
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-redirected-worker-origin-expected.txt (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-redirected-worker-origin-expected.txt 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-redirected-worker-origin-expected.txt 2017-11-08 16:00:18 UTC (rev 224581)
@@ -1,7 +1,6 @@
Blocked access to external URL http://www2.localhost:8800/XMLHttpRequest/resources/inspect-headers.py?filter_name=origin&cors
-PASS XMLHttpRequest: redirected worker scripts, origin and referrer
+FAIL Referer header assert_equals: expected "Referer: http://localhost:8800/XMLHttpRequest/resources/workerxhr-origin-referrer.js\n" but got "Referer: http://localhost:8800/XMLHttpRequest/resources/redirect.py?location=workerxhr-origin-referrer.js\n"
FAIL Origin header assert_equals: expected "Origin: http://localhost:8800\n" but got ""
-FAIL Referer header assert_equals: expected "Referer: http://localhost:8800/XMLHttpRequest/resources/workerxhr-origin-referrer.js\n" but got "Referer: http://localhost:8800/XMLHttpRequest/resources/redirect.py?location=workerxhr-origin-referrer.js\n"
PASS Request URL test
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-redirected-worker-origin.htm (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-redirected-worker-origin.htm 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-redirected-worker-origin.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -1,43 +1,11 @@
- <!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8" />
- <title>XMLHttpRequest: redirected worker scripts, origin and referrer</title>
- <script src=""
- <script src=""
-</head>
-<body>
- <div id="log"></div>
- <script type="text/_javascript_">
- var test = async_test() // This "test" does not actually do any assertations. It's just there to have multiple, separate, asyncronous sub-tests.
- var expectations = {
- 'Referer header': 'Referer: '+(location.href.replace(/[^/]*$/, ''))+"resources/workerxhr-origin-referrer.js\n",
- 'Origin header': 'Origin: '+location.protocol+'//'+location.hostname+((location.port === "")?"":":"+location.port)+'\n',
- 'Request URL test' : (location.href.replace(/[^/]*$/, ''))+'resources/requri.py?full'
- }
- // now start the worker
- var finalWorkerURL = "workerxhr-origin-referrer.js";
- var url = "" + encodeURIComponent(finalWorkerURL);
- var worker = new Worker(url)
- worker._onmessage_ = function (e) {
- var subtest = async_test(e.data.test)
- subtest.step(function(){
- var thisExpectation = expectations[e.data.test]
- delete expectations[e.data.test]
- assert_equals(e.data.result, thisExpectation)
- subtest.done()
- })
- var allDone = true
- for(var prop in expectations){
- allDone = false
- }
- if(allDone){
- test.step(function(){
- test.done()
- })
- }
- }
-
- </script>
-</body>
-</html>
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>XMLHttpRequest: redirected worker scripts, origin and referrer</title>
+<script src=""
+<script src=""
+<div id="log"></div>
+<script>
+var finalWorkerURL = "workerxhr-origin-referrer.js";
+var url = "" + encodeURIComponent(finalWorkerURL);
+fetch_tests_from_worker(new Worker(url));
+</script>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-worker-origin-expected.txt (0 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-worker-origin-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-worker-origin-expected.txt 2017-11-08 16:00:18 UTC (rev 224581)
@@ -0,0 +1,6 @@
+Blocked access to external URL http://www2.localhost:8800/XMLHttpRequest/resources/inspect-headers.py?filter_name=origin&cors
+
+PASS Referer header
+FAIL Origin header assert_equals: expected "Origin: http://localhost:8800\n" but got ""
+PASS Request URL test
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-worker-origin.htm (0 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-worker-origin.htm (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-worker-origin.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>XMLHttpRequest: worker scripts, origin and referrer</title>
+<script src=""
+<script src=""
+<div id="log"></div>
+<script>
+fetch_tests_from_worker(new Worker("resources/workerxhr-origin-referrer.js"));
+</script>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/overridemimetype-open-state-force-xml.htm (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/overridemimetype-open-state-force-xml.htm 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/overridemimetype-open-state-force-xml.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -15,11 +15,11 @@
var client = new XMLHttpRequest();
client._onreadystatechange_ = function() {
if (client.readyState !== 4) return;
- try{
+ try{
var str = client.responseXML.documentElement.tagName+client.responseXML.documentElement.firstChild.tagName+client.responseXML.documentElement.firstChild.textContent;
- }catch(e){
- assert_unreached('Exception when reading responseXML');
- }
+ }catch(e){
+ assert_unreached('Exception when reading responseXML');
+ }
assert_equals( client.responseXML.documentElement.tagName, 'test' );
assert_equals( client.responseXML.documentElement.firstChild.tagName, 'message' );
assert_equals( client.responseXML.documentElement.firstChild.textContent, 'Hello World!' );
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/resources/workerxhr-origin-referrer.js (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/resources/workerxhr-origin-referrer.js 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/resources/workerxhr-origin-referrer.js 2017-11-08 16:00:18 UTC (rev 224581)
@@ -1,34 +1,63 @@
-// This simply posts a message to the owner page with the contents of the Referer header
-var xhr=new XMLHttpRequest()
-xhr._onreadystatechange_ = function(){
- if(xhr.readyState == 4){
- var obj = {test:'Referer header', result:xhr.responseText}
- self.postMessage(obj)
+importScripts("/resources/testharness.js")
+
+async_test(function() {
+ var expected = 'Referer: ' +
+ location.href.replace(/[^/]*$/, '') +
+ "workerxhr-origin-referrer.js\n"
+
+ var xhr = new XMLHttpRequest()
+ xhr._onreadystatechange_ = this.step_func(function() {
+ if (xhr.readyState == 4) {
+ assert_equals(xhr.responseText, expected)
+ this.done()
}
-}
-xhr.open('GET', 'inspect-headers.py?filter_name=referer', true)
-xhr.send()
+ })
+ xhr.open('GET', 'inspect-headers.py?filter_name=referer', true)
+ xhr.send()
+}, 'Referer header')
-// This simply posts a message to the owner page with the contents of the Origin header
-var xhr2=new XMLHttpRequest()
-xhr2._onreadystatechange_ = function(){
- if(xhr2.readyState == 4){
- var obj = {test:'Origin header', result:xhr2.responseText}
- self.postMessage(obj)
+async_test(function() {
+ var expected = 'Origin: ' +
+ location.protocol +
+ '//' +
+ location.hostname +
+ (location.port === "" ? "" : ":" + location.port) +
+ '\n'
+
+ var xhr = new XMLHttpRequest()
+ xhr._onreadystatechange_ = this.step_func(function() {
+ if (xhr.readyState == 4) {
+ assert_equals(xhr.responseText, expected)
+ this.done()
}
-}
-xhr2.open('GET', location.protocol + '//www2.'+location.hostname+((location.port === "")?"":":"+location.port)+(location.pathname.replace(/[^/]*$/, ''))+'inspect-headers.py?filter_name=origin&cors', true)
-xhr2.send()
+ })
+ var url = "" +
+ '//www2.' +
+ location.hostname +
+ (location.port === "" ? "" : ":" + location.port) +
+ location.pathname.replace(/[^/]*$/, '') +
+ 'inspect-headers.py?filter_name=origin&cors'
+ xhr.open('GET', url, true)
+ xhr.send()
+}, 'Origin header')
-// If "origin" / base URL is the origin of this JS file, we can load files
-// from the server it originates from.. and requri.py will be able to tell us
-// what the requested URL was
-var xhr3=new XMLHttpRequest()
-xhr3._onreadystatechange_ = function(){
- if(xhr3.readyState == 4){
- var obj = {test:'Request URL test', result:xhr3.responseText}
- self.postMessage(obj)
+async_test(function() {
+ // If "origin" / base URL is the origin of this JS file, we can load files
+ // from the server it originates from.. and requri.py will be able to tell us
+ // what the requested URL was
+
+ var expected = location.href.replace(/[^/]*$/, '') +
+ 'requri.py?full'
+
+ var xhr = new XMLHttpRequest()
+ xhr._onreadystatechange_ = this.step_func(function() {
+ if (xhr.readyState == 4) {
+ assert_equals(xhr.responseText, expected)
+ this.done()
}
-}
-xhr3.open('GET', 'requri.py?full', true)
-xhr3.send()
+ })
+ xhr.open('GET', 'requri.py?full', true)
+ xhr.send()
+}, 'Request URL test')
+
+done()
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/resources/workerxhr-simple.js (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/resources/workerxhr-simple.js 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/resources/workerxhr-simple.js 2017-11-08 16:00:18 UTC (rev 224581)
@@ -1,10 +1,9 @@
-
var xhr=new XMLHttpRequest()
xhr._onreadystatechange_ = function(){
- if(xhr.readyState == 4){
- var status = xhr.responseText === 'bottom\n' ? 'PASSED' : 'FAILED'
- self.postMessage(status)
- }
+ if(xhr.readyState == 4){
+ var status = xhr.responseText === 'bottom\n' ? 'PASSED' : 'FAILED'
+ self.postMessage(status)
+ }
}
xhr.open('GET', 'folder.txt', true)
xhr.send()
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout-simple.js (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout-simple.js 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout-simple.js 2017-11-08 16:00:18 UTC (rev 224581)
@@ -2,5 +2,5 @@
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) ]);
+ new RequestTracker(true, "load fires normally", TIME_NORMAL_LOAD),
+ new RequestTracker(true, "timeout hit before load", TIME_REGULAR_TIMEOUT) ]);
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout-synconmain.js (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout-synconmain.js 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout-synconmain.js 2017-11-08 16:00:18 UTC (rev 224581)
@@ -1,2 +1,2 @@
runTestRequests([ SyncRequestSettingTimeoutAfterOpen,
- SyncRequestSettingTimeoutBeforeOpen ]);
+ SyncRequestSettingTimeoutBeforeOpen ]);
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout-synconworker.js (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout-synconworker.js 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout-synconworker.js 2017-11-08 16:00:18 UTC (rev 224581)
@@ -1,11 +1,11 @@
if (this.document === undefined){
importScripts("xmlhttprequest-timeout.js");
}else{
- throw "This test expects to be run as a Worker";
+ throw "This test expects to be run as a Worker";
}
/* NOT TESTED: setting timeout before calling open( ... , false) in a worker context. The test code always calls open() first. */
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) ]);
+ new RequestTracker(false, "load fires normally", TIME_NORMAL_LOAD),
+ new RequestTracker(false, "timeout hit before load", TIME_REGULAR_TIMEOUT) ]);
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout-twice.js (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout-twice.js 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout-twice.js 2017-11-08 16:00:18 UTC (rev 224581)
@@ -2,5 +2,5 @@
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) ]);
+ 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) ]);
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout.js (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout.js 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/resources/xmlhttprequest-timeout.js 2017-11-08 16:00:18 UTC (rev 224581)
@@ -245,7 +245,7 @@
/**
* Check the event received, and if it's the right (and only) one we get.
*
- * WebKit fires abort events even for DONE and UNSENT states, which is
+ * WebKit fires abort events even for DONE and UNSENT states, which is
* discussed in http://webkit.org/b/98404
* That's why we chose to accept secondary "abort" events in this test.
*
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsedocument-decoding.htm (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsedocument-decoding.htm 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsedocument-decoding.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -21,7 +21,7 @@
}
const encoded_content = "%e6%a9%9f";
- const encoded_xml =
+ const encoded_xml =
encodeURIComponent("<?xml version='1.0' encoding='windows-1252'?><x>") + encoded_content + encodeURIComponent("<\/x>");
const encoded_html =
encodeURIComponent("<!doctype html><meta charset=windows-1252><x>") + encoded_content + encodeURIComponent("<\/x>");
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-cors-expected.txt (0 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-cors-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-cors-expected.txt 2017-11-08 16:00:18 UTC (rev 224581)
@@ -0,0 +1,4 @@
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/XMLHttpRequest/resources/auth1/corsenabled.py due to access control checks.
+
+PASS XMLHttpRequest: send() - "Basic" authenticated CORS requests with user name and password passed to open() (asserts failure)
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-cors.htm (0 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-cors.htm (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-cors.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -0,0 +1,35 @@
+<!doctype html>
+<html>
+ <head>
+ <title>XMLHttpRequest: send() - "Basic" authenticated CORS requests with user name and password passed to open() (asserts failure)</title>
+ <script src=""
+ <script src=""
+ <link rel="help" href="" data-tested-assertations="following::ol[1]/li[9]/ol[1]/li[1] following::ol[1]/li[9]/ol[1]/li[2]" />
+ <link rel="help" href="" data-tested-assertations="following::code[contains(@title,'http-authorization')]/.." />
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ var test = async_test()
+ test.step(function() {
+ var client = new XMLHttpRequest(),
+ urlstart = 'www1.'+location.host + location.pathname.replace(/\/[^\/]*$/, '/')
+ client.withCredentials = true
+ client.open("GET", location.protocol+'//'+urlstart + "resources/auth1/corsenabled.py", true, 'user', 'pass')
+ client.setRequestHeader("x-user", 'user')
+ client.setRequestHeader("x-pass", 'pass')
+ client._onreadystatechange_ = function(){
+ if (client.readyState === 4) {
+ test.step(function(){
+ assert_equals(client.responseText, '')
+ assert_equals(client.status, 0)
+ assert_equals(client.getResponseHeader('x-challenge'), null)
+ test.done()
+ })
+ }
+ }
+ client.send(null)
+ }, document.title)
+ </script>
+ </body>
+</html>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-repeat-no-args-expected.txt (0 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-repeat-no-args-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-repeat-no-args-expected.txt 2017-11-08 16:00:18 UTC (rev 224581)
@@ -0,0 +1,3 @@
+
+PASS XMLHttpRequest: send() - "Basic" authenticated requests with user name and password passed to open() in first request, without in second
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-repeat-no-args.htm (0 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-repeat-no-args.htm (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-repeat-no-args.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -0,0 +1,33 @@
+<!doctype html>
+<html>
+ <head>
+ <title>XMLHttpRequest: send() - "Basic" authenticated requests with user name and password passed to open() in first request, without in second</title>
+ <script src=""
+ <script src=""
+ <script src=""
+ <link rel="help" href="" data-tested-assertations="following::ol[1]/li[9]/ol[1]/li[1] following::ol[1]/li[9]/ol[1]/li[2]" />
+ <link rel="help" href="" data-tested-assertations="following::code[contains(@title,'http-authorization')]/.." />
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function() {
+ var client = new XMLHttpRequest(),
+ urlstart = location.host + location.pathname.replace(/\/[^\/]*$/, '/'),
+ user = token()
+ client.open("GET", location.protocol+'//'+urlstart + "resources/auth1/auth.py", false, user, 'pass')
+ client.setRequestHeader("x-user", user)
+ client.send(null)
+ // Repeat request but *without* credentials in the open() call.
+ // Is the UA supposed to cache credentials from above request and use them? Yes.
+ client.open("GET", location.protocol+'//'+urlstart + "resources/auth1/auth.py", false)
+ client.setRequestHeader("x-user", user)
+ client.send(null)
+
+ assert_equals(client.responseText, user + "\n" + 'pass')
+ //assert_equals(client.getResponseHeader('x-challenge'), 'DID-NOT')
+
+ }, document.title)
+ </script>
+ </body>
+</html>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-setrequestheader.htm (0 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-setrequestheader.htm (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-setrequestheader.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -0,0 +1,36 @@
+<!doctype html>
+<html>
+ <head>
+ <title>XMLHttpRequest: send() - "Basic" authenticated request using setRequestHeader()</title>
+ <script src=""
+ <script src=""
+ <script src=""
+ <!-- These spec references do not make much sense simply because the spec doesn't say very much about this.. -->
+ <link rel="help" href="" data-tested-assertations="following::ol[1]/li[6]" />
+ <link rel="help" href="" data-tested-assertations="following::code[contains(@title,'http-authorization')]/.." />
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ var test = async_test()
+ test.step(function() {
+ var client = new XMLHttpRequest(),
+ urlstart = location.host + location.pathname.replace(/\/[^\/]*$/, '/'),
+ user = token()
+ client.open("GET", location.protocol+'//'+urlstart + "resources/auth2/auth.py", false)
+ client.setRequestHeader("x-user", user)
+ client.setRequestHeader('Authorization', 'Basic ' + btoa(user + ":pass"))
+ client._onreadystatechange_ = function () {
+ if (client.readyState < 4) {return}
+ test.step( function () {
+ assert_equals(client.responseText, user + '\npass')
+ assert_equals(client.status, 200)
+ assert_equals(client.getResponseHeader('x-challenge'), 'DID-NOT')
+ test.done()
+ } )
+ }
+ client.send(null)
+ })
+ </script>
+ </body>
+</html>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic.htm (0 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic.htm (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -0,0 +1,27 @@
+<!doctype html>
+<html>
+ <head>
+ <title>XMLHttpRequest: send() - "Basic" authenticated requests with user name and password passed to open()</title>
+ <script src=""
+ <script src=""
+ <script src=""
+ <link rel="help" href="" data-tested-assertations="following::ol[1]/li[9]/ol[1]/li[1] following::ol[1]/li[9]/ol[1]/li[2]" />
+ <link rel="help" href="" data-tested-assertations="following::code[contains(@title,'http-authorization')]/.." />
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ test(function() {
+ var client = new XMLHttpRequest(),
+ urlstart = location.host + location.pathname.replace(/\/[^\/]*$/, '/'),
+ user = token();
+ client.open("GET", location.protocol+'//'+urlstart + "resources/auth1/auth.py", false, user, 'pass')
+ client.setRequestHeader("x-user", user)
+ client.send(null)
+ assert_equals(client.responseText, user + "\n" + 'pass')
+ assert_equals(client.getResponseHeader('x-challenge'), 'DID')
+ }, document.title)
+ </script>
+ <p>Note: this test will only work as expected once per browsing session. Restart browser to re-test.</p>
+ </body>
+</html>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-competing-names-passwords-expected.txt (0 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-competing-names-passwords-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-competing-names-passwords-expected.txt 2017-11-08 16:00:18 UTC (rev 224581)
@@ -0,0 +1,8 @@
+
+PASS XMLHttpRequest: send() - "Basic" authenticated requests with competing user name/password options user/pass in open() call
+PASS XMLHttpRequest: send() - "Basic" authenticated requests with competing user name/password options another user/pass in open() call - must override cached credentials from previous test
+PASS XMLHttpRequest: send() - "Basic" authenticated requests with competing user name/password options user/pass both in URL userinfo AND open() call - expexted that open() wins
+PASS XMLHttpRequest: send() - "Basic" authenticated requests with competing user name/password options user/pass *only* in URL userinfo
+PASS XMLHttpRequest: send() - "Basic" authenticated requests with competing user name/password options user name in URL userinfo, password in open() call: user name wins and password is thrown away
+FAIL XMLHttpRequest: send() - "Basic" authenticated requests with competing user name/password options user name and password in URL userinfo, only user name in open() call: user name in open() wins assert_true: responseText should contain the right user and password expected true got false
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-competing-names-passwords.htm (0 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-competing-names-passwords.htm (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-competing-names-passwords.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -0,0 +1,54 @@
+<!doctype html>
+<html>
+ <head>
+ <title>XMLHttpRequest: send() - "Basic" authenticated requests with competing user name/password options</title>
+ <script src=""
+ <script src=""
+ <script src=""
+ <link rel="help" href="" data-tested-assertations="following::ol[1]/li[9]/ol[1]/li[1] following::ol[1]/li[9]/ol[1]/li[2]" />
+ <link rel="help" href="" data-tested-assertations="following::code[contains(@title,'http-authorization')]/.." /> </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ function request(user1, pass1, user2, pass2, name) {
+ // user1, pass1 will if given become userinfo part of URL
+ // user2, pass2 will if given be passed to open() call
+ test(function() {
+ var client = new XMLHttpRequest(),
+ urlstart = "", userwin, passwin
+ // if user2 is set, winning user name and password is 2
+ if(user2)
+ userwin = user2, passwin = pass2
+ // if user1 is set, and user2 is not set, user1 and pass1 win
+ if(user1 && ! user2)
+ userwin = user1, passwin = pass1
+ // if neither user name is set, pass 2 wins (there will be no userinfo in URL)
+ if (!(user1 || user2))
+ passwin = pass2
+ if(user1) { // should add userinfo to URL (there is no way to create userinfo part of URL with only password in)
+ urlstart = "http://" + user1
+ if(pass1)
+ urlstart += ":" + pass1
+ urlstart += "@" + location.host + location.pathname.replace(/\/[^\/]*$/, '/')
+ }
+ client.open("GET", urlstart + "resources/authentication.py", false, user2, pass2)
+ client.setRequestHeader("x-user", userwin)
+ client.send(null)
+ assert_true(client.responseText == ((userwin||'') + "\n" + (passwin||'')), 'responseText should contain the right user and password')
+
+ // We want to send multiple requests to the same realm here, so we try to make the UA forget its (cached) credentials between each test..
+ // forcing a 401 response to (hopefully) "log out"
+ // NOTE: This is commented out because it causes authentication prompts while running the test
+ //client.open('GET', "resources/authentication.py?logout=1", false)
+ //client.send()
+ }, document.title+' '+name)
+ }
+ request(null, null, token(), token(), 'user/pass in open() call')
+ request(null, null, token(), token(), 'another user/pass in open() call - must override cached credentials from previous test')
+ request("userinfo-user", "userinfo-pass", token(), token(), 'user/pass both in URL userinfo AND open() call - expexted that open() wins')
+ request(token(), token(), null, null, 'user/pass *only* in URL userinfo')
+ request(token(), null, null, token(), 'user name in URL userinfo, password in open() call: user name wins and password is thrown away')
+ request("1", token(), token(), null, 'user name and password in URL userinfo, only user name in open() call: user name in open() wins')
+ </script>
+ </body>
+</html>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-basic-expected.txt (0 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-basic-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-basic-expected.txt 2017-11-08 16:00:18 UTC (rev 224581)
@@ -0,0 +1,8 @@
+
+PASS XMLHttpRequest: send() - data argument (1)
+PASS XMLHttpRequest: send() - data argument (10000000)
+PASS XMLHttpRequest: send() - data argument (2,2)
+PASS XMLHttpRequest: send() - data argument (false)
+PASS XMLHttpRequest: send() - data argument (A\0A)
+PASS XMLHttpRequest: send() - data argument (1=2&3=4)
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-basic.htm (0 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-basic.htm (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-basic.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -0,0 +1,28 @@
+<!doctype html>
+<html>
+ <head>
+ <title>XMLHttpRequest: send() - data argument</title>
+ <script src=""
+ <script src=""
+ <link rel="help" href="" data-tested-assertations="/following::ol/li[4]" />
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ function request(input, output) {
+ test(function() {
+ var client = new XMLHttpRequest()
+ client.open("POST", "resources/content.py", false)
+ client.send(input)
+ assert_equals(client.responseText, output)
+ }, document.title + " (" + output + ")")
+ }
+ request(1, "1")
+ request(10000000, "10000000")
+ request([2,2], "2,2")
+ request(false, "false")
+ request("A\0A", "A\0A")
+ request(new URLSearchParams([[1, 2], [3, 4]]), "1=2&3=4")
+ </script>
+ </body>
+</html>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-document-expected.txt (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-document-expected.txt 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-document-expected.txt 2017-11-08 16:00:18 UTC (rev 224581)
@@ -1,9 +1,9 @@
PASS XML document, windows-1252
+PASS HTML document, invalid UTF-8
+PASS HTML document, shift-jis
+PASS plain text file
PASS image file
PASS img tag
-PASS HTML document, invalid UTF-8
-PASS HTML document, shift-jis
PASS empty div
-PASS plain text file
-
+
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-document.htm (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-document.htm 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-document.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -11,51 +11,82 @@
<body>
<div id="log"></div>
<script>
- var expectations = [
- { contentType: 'application/xml;charset=UTF-8', responseText : '<\u00FF\/>' },
- { contentType: 'text/html;charset=UTF-8', responseText : '<body>\uFFFD<\/body>' }, /*invalid character code in document turns into FFFD*/
- { contentType: 'text/html;charset=UTF-8', responseText : '<body>\u30C6\u30b9\u30c8<\/body>' } /* correctly serialized Shift-JIS */,
- { contentType: 'text/html;charset=UTF-8', responseText: 'top' }, /* There's some markup included, but it's not really relevant for this test suite, so we do an indexOf() test */
- { contentType: 'text/html;charset=UTF-8' },
- { contentType: 'text/html;charset=UTF-8', responseText: '<img>foo' },
- { contentType: 'text/html;charset=UTF-8', responseText: '<!DOCTYPE html><html><head></head><body><div></div></body></html>' }
- ]
+ var tests = [
+ {
+ title: 'XML document, windows-1252',
+ url: 'resources/win-1252-xml.py',
+ contentType: 'application/xml;charset=UTF-8',
+ responseText: '<\u00FF\/>'
+ },
+ // Invalid character code in document turns into U+FFFD.
+ {
+ title: 'HTML document, invalid UTF-8',
+ url: 'resources/invalid-utf8-html.py',
+ contentType: 'text/html;charset=UTF-8',
+ responseText: '<body>\uFFFD<\/body>'
+ },
+ // Correctly serialized Shift-JIS.
+ {
+ title: 'HTML document, shift-jis',
+ url: 'resources/shift-jis-html.py',
+ contentType: 'text/html;charset=UTF-8',
+ responseText: '<body>\u30C6\u30b9\u30c8<\/body>'
+ },
+ // There's some markup included, but it's not really relevant for this
+ // test suite, so we do an indexOf() test.
+ {
+ title: 'plain text file',
+ url: 'folder.txt',
+ contentType: 'text/html;charset=UTF-8',
+ responseText: 'top'
+ },
+ // This test does not want to assert anything about what markup a
+ // standalone image should be wrapped in. Hence this test lacks a
+ // responseText expectation.
+ {
+ title: 'image file',
+ url: 'resources/image.gif',
+ contentType: 'text/html;charset=UTF-8'
+ },
+ {
+ title: 'img tag',
+ url: 'resources/img-utf8-html.py',
+ contentType: 'text/html;charset=UTF-8',
+ responseText: '<img>foo'
+ },
+ {
+ title: 'empty div',
+ url: 'resources/empty-div-utf8-html.py',
+ contentType: 'text/html;charset=UTF-8',
+ responseText: '<!DOCTYPE html><html><head></head><body><div></div></body></html>'
+ }
+ ];
-
- function request(input, number, title) {
- test(function() {
+ tests.forEach(function(t) {
+ async_test(function() {
+ var iframe = document.createElement("iframe");
+ iframe._onload_ = this.step_func_done(function() {
var client = new XMLHttpRequest()
client.open("POST", "resources/content.py?response_charset_label=UTF-8", false)
- client.send(input)
- var exp = expectations[number]
- assert_equals(client.getResponseHeader('X-Request-Content-Type'), exp.contentType, 'document should be serialized and sent as '+exp.contentType+' (TEST#'+number+')')
- // The indexOf() assertation will overlook some stuff, i.e. XML prologues that shouldn't be there (looking at you, Presto).
- // However, arguably these things have little to do with the XHR functionality we're testing.
- if(exp.responseText){ // This test does not want to assert anything about what markup a standalone IMG should be wrapped in. Hence the GIF test lacks a responseText expectation.
- assert_true(client.responseText.indexOf(exp.responseText) != -1,
- JSON.stringify(exp.responseText) + " not in " +
+ client.send(iframe.contentDocument)
+ assert_equals(client.getResponseHeader('X-Request-Content-Type'),
+ t.contentType,
+ 'document should be serialized and sent as ' + t.contentType)
+ // The indexOf() assertion will overlook some stuff, e.g. XML
+ // prologues that shouldn't be there (looking at you, Presto).
+ // However, arguably these things have little to do with the XHR
+ // functionality we're testing.
+ if (t.responseText) {
+ assert_true(client.responseText.indexOf(t.responseText) != -1,
+ JSON.stringify(t.responseText) + " not in " +
JSON.stringify(client.responseText));
}
assert_equals(client.responseXML, null)
- }, title)
- }
- function init(fr, number, title) { request(fr.contentDocument, number, title) }
+ });
+ iframe.src = ""
+ document.body.appendChild(iframe);
+ }, t.title);
+ });
</script>
- <!--
- This test also tests how documents in various encodings are serialized.
- The below IFRAMEs contain:
- * one XML document parsed from a windows-1252 source - content is <ÿ/>
- * one HTML-document parsed from an invalid UTF-8 source, will contain a basic HTML DOM
- with a U+FFFD replacement character for the invalid char
- * one HTML document parsed from a valid Shift-JIS source
- -->
- <iframe src='' _onload_="init(this, 0, 'XML document, windows-1252')"></iframe>
- <iframe src='' _onload_="init(this, 1, 'HTML document, invalid UTF-8')"></iframe>
- <iframe src='' _onload_="init(this, 2, 'HTML document, shift-jis')"></iframe>
- <iframe src='' _onload_="init(this, 3, 'plain text file')"></iframe>
- <iframe src='' _onload_="init(this, 4, 'image file')"></iframe>
- <iframe src='' _onload_="init(this, 5, 'img tag')"></iframe>
- <iframe src='' _onload_="init(this, 6, 'empty div')"></iframe>
-
</body>
</html>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-get-head-async.htm (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-get-head-async.htm 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-get-head-async.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -4,7 +4,7 @@
<title>XMLHttpRequest: send() - non-empty data argument and GET/HEAD - async, no upload events should fire</title>
<script src=""
<script src=""
- <link rel="help" href="" data-tested-assertations="following::OL[1]/LI[3] following::OL[1]/LI[7] following::OL[1]/LI[8]" />
+ <link rel="help" href="" data-tested-assertations="following::OL[1]/LI[3] following::OL[1]/LI[7] following::OL[1]/LI[8]" />
</head>
<body>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-get-head.htm (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-get-head.htm 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-get-head.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -4,7 +4,7 @@
<title>XMLHttpRequest: send() - non-empty data argument and GET/HEAD</title>
<script src=""
<script src=""
- <link rel="help" href="" data-tested-assertations="following::OL[1]/LI[3] following::OL[1]/LI[7]" />
+ <link rel="help" href="" data-tested-assertations="following::OL[1]/LI[3] following::OL[1]/LI[7]" />
</head>
<body>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-network-error-async-events.sub-expected.txt (0 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-network-error-async-events.sub-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-network-error-async-events.sub-expected.txt 2017-11-08 16:00:18 UTC (rev 224581)
@@ -0,0 +1,4 @@
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://nonexistent-origin.localhost:8800/ due to access control checks.
+
+PASS XMLHttpRequest: The send() method: Fire a progress event named error when Network error happens (synchronous flag is unset)
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-network-error-async-events.sub.htm (0 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-network-error-async-events.sub.htm (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-network-error-async-events.sub.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <link rel="help" href="" data-tested-assertations="../.." />
+ <link rel="help" href="" data-tested-assertations="following::ol[1]/li[9]/ol/li[2] following::ol[1]/li[9]/ol/li[3]" />
+ <link rel="help" href="" data-tested-assertations="following::dt[4] following::dd[4]/p" />
+ <link rel="help" href="" data-tested-assertations=".." />
+ <link rel="help" href="" data-tested-assertations="following::ol[1]/li[4] following::ol[1]/li[6] following::ol[1]/li[7] following::ol[1]/li[7]/ol/li[3] following::ol[1]/li[7]/ol/li[4] following::ol[1]/li[9] following::ol[1]/li[10]" />
+ <script src=""
+ <script src=""
+ <title>XMLHttpRequest: The send() method: Fire a progress event named error when Network error happens (synchronous flag is unset)</title>
+</head>
+
+<body>
+ <div id="log"></div>
+
+ <script type="text/_javascript_">
+ var test = async_test();
+
+ test.step(function(){
+ var xhr = new XMLHttpRequest();
+ var expect = ["loadstart", "upload.loadstart", 4, "upload.error", "upload.loadend", "error", "loadend"];
+ var actual = [];
+
+ xhr._onreadystatechange_ = test.step_func(() => {
+ if (xhr.readyState == 4) {
+ actual.push(xhr.readyState);
+ }
+ });
+
+ xhr._onloadstart_ = test.step_func(e => { actual.push(e.type); })
+ xhr._onloadend_ = test.step_func_done(e => {
+ actual.push(e.type);
+ assert_array_equals(actual, expect);
+ })
+ xhr._onerror_ = test.step_func(e => { actual.push(e.type); })
+
+ xhr.upload._onloadstart_ = test.step_func(e => { actual.push("upload." + e.type); })
+ xhr.upload._onloadend_ = test.step_func(e => { actual.push("upload." + e.type); })
+ xhr.upload._onerror_ = test.step_func(e => { actual.push("upload." + e.type); })
+
+ xhr.open("POST", "http://nonexistent-origin.{{host}}:{{ports[http][0]}}", true);
+ xhr.send("Test Message");
+ });
+ </script>
+</body>
+</html>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-redirect-infinite.htm (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-redirect-infinite.htm 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-redirect-infinite.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -29,7 +29,7 @@
test.done()
})
}
- client.send(null)
+ client.send(null)
</script>
</body>
</html>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-redirect-no-location.htm (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-redirect-no-location.htm 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-redirect-no-location.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -5,7 +5,7 @@
<script src=""
<script src=""
<link rel="help" href="" data-tested-assertations="following::dl[1]/dt[2]" />
- <!--
+ <!--
NOTE: the XHR spec does not really handle this scenario. It's handled in the Fetch spec:
"If response's headers do not contain a header whose name is Location, return response."
-->
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-redirect-post-upload.htm (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-redirect-post-upload.htm 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-redirect-post-upload.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -25,7 +25,7 @@
// 307 redirects should resend the POST data, and events and headers will be a little different..
if(shouldResendPost) {
- expectedHeaders = {
+ expectedHeaders = {
"X-Request-Content-Length": "11988",
"X-Request-Content-Type": "text/plain;charset=UTF-8",
"X-Request-Method": "POST",
@@ -45,12 +45,12 @@
];
} else {
// setting the right expectations for POST resent as GET without request body
- expectedHeaders = {
+ expectedHeaders = {
"X-Request-Content-Length": "NO",
"X-Request-Content-Type": "NO",
"X-Request-Method": "GET",
"X-Request-Query": "NO"
- }
+ }
expectedEvents = [
"xhr onreadystatechange 1",
"xhr loadstart 1",
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/setrequestheader-after-send.htm (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/setrequestheader-after-send.htm 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/setrequestheader-after-send.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -4,7 +4,7 @@
<title>XMLHttpRequest: setRequestHeader() after send()</title>
<script src=""
<script src=""
- <link rel="help" href="" data-tested-assertations="/following::ol/li[2]" />
+ <link rel="help" href="" data-tested-assertations="/following::ol/li[2]" />
</head>
<body>
<div id="log"></div>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/setrequestheader-before-open.htm (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/setrequestheader-before-open.htm 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/setrequestheader-before-open.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -4,7 +4,7 @@
<title>XMLHttpRequest: setRequestHeader() before open()</title>
<script src=""
<script src=""
- <link rel="help" href="" data-tested-assertations="following::ol/li[1]" />
+ <link rel="help" href="" data-tested-assertations="following::ol/li[1]" />
</head>
<body>
<div id="log"></div>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/w3c-import.log (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/w3c-import.log 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/w3c-import.log 2017-11-08 16:00:18 UTC (rev 224581)
@@ -153,6 +153,7 @@
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-6.htm
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window.htm
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-redirected-worker-origin.htm
+/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-worker-origin.htm
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-worker-simple.htm
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-user-password-non-same-origin.htm
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/overridemimetype-blob.html
@@ -190,7 +191,12 @@
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/security-consideration.sub.html
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-accept-language.htm
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-accept.htm
+/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-cors.htm
+/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-repeat-no-args.htm
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-setrequestheader-and-arguments.htm
+/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-setrequestheader.htm
+/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic.htm
+/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-competing-names-passwords.htm
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-cors-basic-setrequestheader.htm
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-cors-setrequestheader-no-cred.htm
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-blob-with-no-mime-type.html
@@ -204,6 +210,7 @@
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-data-es-object.htm
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-data-formdata.htm
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-data-unexpected-tostring.htm
+/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-basic.htm
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-document-bogus.htm
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-document.htm
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-empty.htm
@@ -210,6 +217,7 @@
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-get-head-async.htm
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-get-head.htm
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-none.htm
+/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-network-error-async-events.sub.htm
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-network-error-sync-events.sub.htm
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-no-response-event-loadend.htm
/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-no-response-event-loadstart.htm
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/xmlhttprequest-timeout-reused.html (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/xmlhttprequest-timeout-reused.html 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/xmlhttprequest-timeout-reused.html 2017-11-08 16:00:18 UTC (rev 224581)
@@ -17,15 +17,16 @@
<div id="log"></div>
<script type="text/_javascript_">
+var test = async_test();
+
function startRequest() {
xhr.open("GET", "./resources/content.py?content=Hi", true);
xhr.timeout = 2000;
- setTimeout(function () {
+ test.step_timeout(function () {
xhr.send();
}, 1000);
}
-var test = async_test();
test.step(function()
{
var count = 0;
@@ -40,7 +41,7 @@
assert_unreached("HTTP error should not timeout");
}
startRequest();
- setTimeout(startRequest, 3500);
+ test.step_timeout(startRequest, 3500);
});
</script>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/xmlhttprequest-unsent.htm (224580 => 224581)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/xmlhttprequest-unsent.htm 2017-11-08 15:53:41 UTC (rev 224580)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/xmlhttprequest-unsent.htm 2017-11-08 16:00:18 UTC (rev 224581)
@@ -4,16 +4,16 @@
<title>XMLHttpRequest: members during UNSENT</title>
<script src=""
<script src=""
- <link rel="help" href="" data-tested-assertations=".. following::dd" />
- <link rel="help" href="" data-tested-assertations="following::ol/li[1]" />
- <link rel="help" href="" data-tested-assertations="following::ol/li[1]" />
- <link rel="help" href="" data-tested-assertations="following::ol/li[1]" />
- <link rel="help" href="" data-tested-assertations="following::ol/li[1]" />
- <link rel="help" href="" data-tested-assertations="following::ol/li[1]" />
- <link rel="help" href="" data-tested-assertations="following::ol/li[1]" />
- <link rel="help" href="" data-tested-assertations="following::ol/li[2]" />
- <link rel="help" href="" data-tested-assertations="following::ol/li[2]" />
-
+ <link rel="help" href="" data-tested-assertations=".. following::dd" />
+ <link rel="help" href="" data-tested-assertations="following::ol/li[1]" />
+ <link rel="help" href="" data-tested-assertations="following::ol/li[1]" />
+ <link rel="help" href="" data-tested-assertations="following::ol/li[1]" />
+ <link rel="help" href="" data-tested-assertations="following::ol/li[1]" />
+ <link rel="help" href="" data-tested-assertations="following::ol/li[1]" />
+ <link rel="help" href="" data-tested-assertations="following::ol/li[1]" />
+ <link rel="help" href="" data-tested-assertations="following::ol/li[2]" />
+ <link rel="help" href="" data-tested-assertations="following::ol/li[2]" />
+
</head>
<body>
<div id="log"></div>