Title: [223203] trunk/LayoutTests/imported/w3c
Revision
223203
Author
[email protected]
Date
2017-10-11 12:40:31 -0700 (Wed, 11 Oct 2017)

Log Message

Re-sync XMLHttpRequests Web-Platform-Tests
https://bugs.webkit.org/show_bug.cgi?id=178172

Reviewed by Youenn Fablet.

Re-sync XMLHttpRequests Web-Platform-Tests from upstream 2f76ef2c1d.

* resources/import-expectations.json:
* web-platform-tests/XMLHttpRequest/abort-after-stop-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/abort-after-stop.htm: Added.
* web-platform-tests/XMLHttpRequest/event-error-order.sub-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/event-error-order.sub.html: Added.
* web-platform-tests/XMLHttpRequest/event-timeout-order-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/event-timeout-order.htm: Added.
* 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/preserve-ua-header-on-redirect-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/preserve-ua-header-on-redirect.htm: Added.
* web-platform-tests/XMLHttpRequest/responsedocument-decoding-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/responsedocument-decoding.htm: Added.
* web-platform-tests/XMLHttpRequest/responsetext-decoding-expected.txt:
* web-platform-tests/XMLHttpRequest/responsetext-decoding.htm:
* web-platform-tests/XMLHttpRequest/send-after-setting-document-domain-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/send-after-setting-document-domain.htm: Added.
* web-platform-tests/XMLHttpRequest/send-authentication-basic-cors-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/send-authentication-basic-cors-not-enabled-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/send-authentication-basic-cors-not-enabled.htm: Added.
* web-platform-tests/XMLHttpRequest/send-authentication-basic-cors.htm: Added.
* web-platform-tests/XMLHttpRequest/send-authentication-basic-expected.txt: 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-expected.txt: 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-network-error-async-events.sub-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/send-network-error-async-events.sub.htm: Added.
* web-platform-tests/XMLHttpRequest/w3c-import.log:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (223202 => 223203)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2017-10-11 19:33:48 UTC (rev 223202)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2017-10-11 19:40:31 UTC (rev 223203)
@@ -1,3 +1,47 @@
+2017-10-11  Chris Dumez  <[email protected]>
+
+        Re-sync XMLHttpRequests Web-Platform-Tests
+        https://bugs.webkit.org/show_bug.cgi?id=178172
+
+        Reviewed by Youenn Fablet.
+
+        Re-sync XMLHttpRequests Web-Platform-Tests from upstream 2f76ef2c1d.
+
+        * resources/import-expectations.json:
+        * web-platform-tests/XMLHttpRequest/abort-after-stop-expected.txt: Added.
+        * web-platform-tests/XMLHttpRequest/abort-after-stop.htm: Added.
+        * web-platform-tests/XMLHttpRequest/event-error-order.sub-expected.txt: Added.
+        * web-platform-tests/XMLHttpRequest/event-error-order.sub.html: Added.
+        * web-platform-tests/XMLHttpRequest/event-timeout-order-expected.txt: Added.
+        * web-platform-tests/XMLHttpRequest/event-timeout-order.htm: Added.
+        * 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/preserve-ua-header-on-redirect-expected.txt: Added.
+        * web-platform-tests/XMLHttpRequest/preserve-ua-header-on-redirect.htm: Added.
+        * web-platform-tests/XMLHttpRequest/responsedocument-decoding-expected.txt: Added.
+        * web-platform-tests/XMLHttpRequest/responsedocument-decoding.htm: Added.
+        * web-platform-tests/XMLHttpRequest/responsetext-decoding-expected.txt:
+        * web-platform-tests/XMLHttpRequest/responsetext-decoding.htm:
+        * web-platform-tests/XMLHttpRequest/send-after-setting-document-domain-expected.txt: Added.
+        * web-platform-tests/XMLHttpRequest/send-after-setting-document-domain.htm: Added.
+        * web-platform-tests/XMLHttpRequest/send-authentication-basic-cors-expected.txt: Added.
+        * web-platform-tests/XMLHttpRequest/send-authentication-basic-cors-not-enabled-expected.txt: Added.
+        * web-platform-tests/XMLHttpRequest/send-authentication-basic-cors-not-enabled.htm: Added.
+        * web-platform-tests/XMLHttpRequest/send-authentication-basic-cors.htm: Added.
+        * web-platform-tests/XMLHttpRequest/send-authentication-basic-expected.txt: 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-expected.txt: 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-network-error-async-events.sub-expected.txt: Added.
+        * web-platform-tests/XMLHttpRequest/send-network-error-async-events.sub.htm: Added.
+        * web-platform-tests/XMLHttpRequest/w3c-import.log:
+
 2017-10-11  Youenn Fablet  <[email protected]>
 
         Import media capture WPT tests

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-after-stop-expected.txt (0 => 223203)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-after-stop-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-after-stop-expected.txt	2017-10-11 19:40:31 UTC (rev 223203)
@@ -0,0 +1,5 @@
+
+Harness Error (TIMEOUT), message = null
+
+FAIL XMLHttpRequest: abort event should fire when stop() method is used assert_equals: expected true but got false
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-after-stop.htm (0 => 223203)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-after-stop.htm	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-after-stop.htm	2017-10-11 19:40:31 UTC (rev 223203)
@@ -0,0 +1,30 @@
+<!doctype html>
+<html>
+  <head>
+    <title>XMLHttpRequest: abort event should fire when stop() method is used</title>
+    <script src=""
+    <script src=""
+    <link rel="help" href="" data-tested-assertations="following::dt[3] following::dt[3]/following::dd[1]/p"/>
+  </head>
+  <body>
+    <div id="log"></div>
+    <script>
+      var test = async_test();
+      test.step(function() {
+        var client = new XMLHttpRequest();
+        var abortFired = false;
+        client._onabort_ = test.step_func(function (e) {
+          assert_equals(e.type, 'abort');
+          abortFired = true;
+        });
+        client.open("GET", "resources/delay.py?ms=3000", true);
+        client.send(null);
+        test.step_timeout(() => {
+          assert_equals(abortFired, true);
+          test.done();
+        }, 200);
+        window.stop();
+      });
+    </script>
+  </body>
+</html>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/event-error-order.sub-expected.txt (0 => 223203)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/event-error-order.sub-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/event-error-order.sub-expected.txt	2017-10-11 19:40:31 UTC (rev 223203)
@@ -0,0 +1,4 @@
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://nonexistent-origin.localhost:8800/ due to access control checks.
+
+FAIL XMLHttpRequest: event - error (order of events) assert_equals: expected "upload.loadstart(0,12,true)" but got "upload.loadstart(0,0,false)"
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/event-error-order.sub.html (0 => 223203)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/event-error-order.sub.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/event-error-order.sub.html	2017-10-11 19:40:31 UTC (rev 223203)
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta name="assert" content="Check the order of events fired when the request has failed.">
+    <script src=""
+    <script src=""
+    <script src=""
+    <title>XMLHttpRequest: event - error (order of events)</title>
+</head>
+
+<body>
+    <div id="log"></div>
+
+    <script type="text/_javascript_">
+        var test = async_test();
+
+        test.step(function()
+        {
+            var xhr = new XMLHttpRequest();
+            prepare_xhr_for_event_order_test(xhr);
+
+            xhr.addEventListener("loadend", function() {
+                test.step(function() {
+                    // no progress events due to CORS failure
+                    assert_xhr_event_order_matches([1, "loadstart(0,0,false)", "upload.loadstart(0,12,true)", 2, 4, "upload.error(0,0,false)", "upload.loadend(0,0,false)", "error(0,0,false)", "loadend(0,0,false)"]);
+                    test.done();
+                });
+            });
+
+            xhr.open("POST", "http://nonexistent-origin.{{host}}:{{ports[http][0]}}", true);
+            xhr.send("Test Message");
+        });
+    </script>
+</body>
+</html>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/event-timeout-order-expected.txt (0 => 223203)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/event-timeout-order-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/event-timeout-order-expected.txt	2017-10-11 19:40:31 UTC (rev 223203)
@@ -0,0 +1,3 @@
+
+FAIL XMLHttpRequest: event - timeout (order of events) assert_equals: expected "upload.loadstart(0,12,true)" but got "upload.loadstart(0,0,false)"
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/event-timeout-order.htm (0 => 223203)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/event-timeout-order.htm	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/event-timeout-order.htm	2017-10-11 19:40:31 UTC (rev 223203)
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta name="assert" content="Check the order of events fired when the request has failed.">
+    <script src=""
+    <script src=""
+    <script src=""
+    <title>XMLHttpRequest: event - timeout (order of events)</title>
+</head>
+
+<body>
+    <div id="log"></div>
+
+    <script type="text/_javascript_">
+        var test = async_test();
+
+        test.step(function()
+        {
+            var xhr = new XMLHttpRequest();
+            prepare_xhr_for_event_order_test(xhr);
+            xhr.addEventListener("loadend", function() {
+                test.step(function() {
+                    assert_xhr_event_order_matches([1, "loadstart(0,0,false)", "upload.loadstart(0,12,true)", 4, "upload.timeout(0,0,false)", "upload.loadend(0,0,false)", "timeout(0,0,false)", "loadend(0,0,false)"]);
+                    test.done();
+                });
+            });
+
+            xhr.timeout = 5;
+            xhr.open("POST", "resources/delay.py?ms=20000");
+            xhr.send("Test Message");
+            test.step_timeout(() => {
+              assert_unreached("ontimeout not called.");
+            }, 10);
+        });
+    </script>
+</body>
+</html>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-worker-origin-expected.txt (0 => 223203)


--- 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-10-11 19:40:31 UTC (rev 223203)
@@ -0,0 +1,7 @@
+Blocked access to external URL http://www2.localhost:8800/XMLHttpRequest/resources/inspect-headers.py?filter_name=origin&cors
+
+PASS XMLHttpRequest: worker scripts, origin and referrer 
+FAIL Origin header assert_equals: expected "Origin: http://localhost:8800\n" but got ""
+PASS Referer header 
+PASS Request URL test 
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-worker-origin.htm (0 => 223203)


--- 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-10-11 19:40:31 UTC (rev 223203)
@@ -0,0 +1,43 @@
+ <!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8" />
+    <title>XMLHttpRequest: worker scripts, origin and referrer</title>
+    <script src=""
+    <script src=""
+    <link rel="help" href="" data-tested-assertations="following::OL[1]/LI[3] following::OL[1]/LI[3]/ol[1]/li[1] following::OL[1]/LI[3]/ol[1]/li[2] following::OL[1]/LI[3]/ol[1]/li[3]" />
+</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 worker = new Worker("resources/workerxhr-origin-referrer.js")
+        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>
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsedocument-decoding-expected.txt (0 => 223203)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsedocument-decoding-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsedocument-decoding-expected.txt	2017-10-11 19:40:31 UTC (rev 223203)
@@ -0,0 +1,8 @@
+
+PASS XMLHttpRequest: response document decoding (application/xml %3C%3Fxml%20version%3D'1.0'%20encoding%3D'windows-1252'%3F%3E%3Cx%3E%e6%a9%9f%3C%2Fx%3E) 
+PASS XMLHttpRequest: response document decoding (application/xml;charset=utf-8 %3C%3Fxml%20version%3D'1.0'%20encoding%3D'windows-1252'%3F%3E%3Cx%3E%e6%a9%9f%3C%2Fx%3E) 
+PASS XMLHttpRequest: response document decoding (application/xml;charset=windows-1252 %3C%3Fxml%20version%3D'1.0'%20encoding%3D'windows-1252'%3F%3E%3Cx%3E%e6%a9%9f%3C%2Fx%3E) 
+PASS XMLHttpRequest: response document decoding (text/html %3C!doctype%20html%3E%3Cmeta%20charset%3Dwindows-1252%3E%3Cx%3E%e6%a9%9f%3C%2Fx%3E) 
+PASS XMLHttpRequest: response document decoding (text/html;charset=utf-8 %3C!doctype%20html%3E%3Cmeta%20charset%3Dwindows-1252%3E%3Cx%3E%e6%a9%9f%3C%2Fx%3E) 
+PASS XMLHttpRequest: response document decoding (text/html;charset=windows-1252 %3C!doctype%20html%3E%3Cmeta%20charset%3Dwindows-1252%3E%3Cx%3E%e6%a9%9f%3C%2Fx%3E) 
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsedocument-decoding.htm (0 => 223203)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsedocument-decoding.htm	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsedocument-decoding.htm	2017-10-11 19:40:31 UTC (rev 223203)
@@ -0,0 +1,39 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <title>XMLHttpRequest: response document decoding</title>
+    <script src=""
+    <script src=""
+  </head>
+  <body>
+    <script>
+      function request(type, input, expected) {
+        async_test((test) => {
+          const client = new XMLHttpRequest();
+          client.responseType = 'document';
+          client.open("GET", "resources/status.py?content=" + input + "&type=" + encodeURIComponent(type), true);
+          client._onload_ = test.step_func_done(() => {
+            assert_equals(client.responseXML.querySelector("x").textContent, expected);
+          })
+          client.send(null);
+        }, document.title + " (" + type + " " + input + ")");
+      }
+
+      const encoded_content = "%e6%a9%9f";
+      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>");
+      const decoded_as_windows_1252 = "\u00e6\u00a9\u0178";
+      const decoded_as_utf_8 = "\u6a5f";
+
+      request("application/xml", encoded_xml, decoded_as_windows_1252);
+      request("application/xml;charset=utf-8", encoded_xml, decoded_as_utf_8);
+      request("application/xml;charset=windows-1252", encoded_xml, decoded_as_windows_1252);
+      request("text/html", encoded_html, decoded_as_windows_1252);
+      request("text/html;charset=utf-8", encoded_html, decoded_as_utf_8);
+      request("text/html;charset=windows-1252", encoded_html, decoded_as_windows_1252);
+    </script>
+  </body>
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsetext-decoding-expected.txt (223202 => 223203)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsetext-decoding-expected.txt	2017-10-11 19:33:48 UTC (rev 223202)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsetext-decoding-expected.txt	2017-10-11 19:40:31 UTC (rev 223203)
@@ -1,17 +1,38 @@
 
-PASS XMLHttpRequest: responseText decoding (application/xml %3C%3Fxml%20version%3D'1.0'%20encoding%3D'windows-1252'%3F%3E%3Cx%3E%FF%3C%2Fx%3E) 
-FAIL XMLHttpRequest: responseText decoding (text/html %3C!doctype%20html%3E%3Cmeta%20charset%3Dwindows-1252%3E%FF) assert_equals: expected "<!doctype html><meta charset=windows-1252>\ufffd" but got "<!doctype html><meta charset=windows-1252>ÿ"
-PASS XMLHttpRequest: responseText decoding (text/plain;charset=windows-1252 %FF) 
-PASS XMLHttpRequest: responseText decoding (text/plain %FF) 
-PASS XMLHttpRequest: responseText decoding (text/plain %FE%FF) 
-PASS XMLHttpRequest: responseText decoding (text/plain %FE%FF%FE%FF) 
-PASS XMLHttpRequest: responseText decoding (text/plain %EF%BB%BF) 
-PASS XMLHttpRequest: responseText decoding (text/plain %EF%BB%BF%EF%BB%BF) 
-PASS XMLHttpRequest: responseText decoding (text/plain %C2) 
-PASS XMLHttpRequest: responseText decoding (text/xml %FE%FF) 
-PASS XMLHttpRequest: responseText decoding (text/xml %FE%FF%FE%FF) 
-PASS XMLHttpRequest: responseText decoding (text/xml %EF%BB%BF) 
-PASS XMLHttpRequest: responseText decoding (text/xml %EF%BB%BF%EF%BB%BF) 
-PASS XMLHttpRequest: responseText decoding (text/plain %E3%81%B2) 
-FAIL XMLHttpRequest: responseText decoding (text/xml %3C%3Fxml%20version%3D'1.0'%20encoding%3D'windows-1252'%3F%3E%3Cx%3E%E3%81%B2%3C%2Fx%3E) assert_equals: expected "<?xml version='1.0' encoding='windows-1252'?><x>ひ</x>" but got "<?xml version='1.0' encoding='windows-1252'?><x>ひ</x>"
+PASS XMLHttpRequest: responseText decoding (application/xml %3C%3Fxml%20version%3D'1.0'%20encoding%3D'windows-1252'%3F%3E%3Cx%3E%e6%a9%9f%3C%2Fx%3E empty) 
+FAIL XMLHttpRequest: responseText decoding (text/html %3C!doctype%20html%3E%3Cmeta%20charset%3Dwindows-1252%3E%3Cx%3E%e6%a9%9f%3C%2Fx%3E empty) assert_equals: expected "<!doctype html><meta charset=windows-1252><x>機</x>" but got "<!doctype html><meta charset=windows-1252><x>機</x>"
+PASS XMLHttpRequest: responseText decoding (application/xml;charset=utf-8 %3C%3Fxml%20version%3D'1.0'%20encoding%3D'windows-1252'%3F%3E%3Cx%3E%e6%a9%9f%3C%2Fx%3E empty) 
+PASS XMLHttpRequest: responseText decoding (application/xml;charset=windows-1252 %3C%3Fxml%20version%3D'1.0'%20encoding%3D'windows-1252'%3F%3E%3Cx%3E%e6%a9%9f%3C%2Fx%3E empty) 
+PASS XMLHttpRequest: responseText decoding (text/html;charset=utf-8 %3C!doctype%20html%3E%3Cmeta%20charset%3Dwindows-1252%3E%3Cx%3E%e6%a9%9f%3C%2Fx%3E empty) 
+PASS XMLHttpRequest: responseText decoding (text/html;charset=windows-1252 %3C!doctype%20html%3E%3Cmeta%20charset%3Dwindows-1252%3E%3Cx%3E%e6%a9%9f%3C%2Fx%3E empty) 
+PASS XMLHttpRequest: responseText decoding (text/plain;charset=windows-1252 %FF empty) 
+PASS XMLHttpRequest: responseText decoding (text/plain %FF empty) 
+PASS XMLHttpRequest: responseText decoding (text/plain %FE%FF empty) 
+PASS XMLHttpRequest: responseText decoding (text/plain %FE%FF%FE%FF empty) 
+PASS XMLHttpRequest: responseText decoding (text/plain %EF%BB%BF empty) 
+PASS XMLHttpRequest: responseText decoding (text/plain %EF%BB%BF%EF%BB%BF empty) 
+PASS XMLHttpRequest: responseText decoding (text/plain %C2 empty) 
+PASS XMLHttpRequest: responseText decoding (text/xml %FE%FF empty) 
+PASS XMLHttpRequest: responseText decoding (text/xml %FE%FF%FE%FF empty) 
+PASS XMLHttpRequest: responseText decoding (text/xml %EF%BB%BF empty) 
+PASS XMLHttpRequest: responseText decoding (text/xml %EF%BB%BF%EF%BB%BF empty) 
+PASS XMLHttpRequest: responseText decoding (text/plain %E3%81%B2 empty) 
+FAIL XMLHttpRequest: responseText decoding (application/xml %3C%3Fxml%20version%3D'1.0'%20encoding%3D'windows-1252'%3F%3E%3Cx%3E%e6%a9%9f%3C%2Fx%3E  text) assert_equals: expected "<?xml version='1.0' encoding='windows-1252'?><x>機</x>" but got "<?xml version='1.0' encoding='windows-1252'?><x>機</x>"
+FAIL XMLHttpRequest: responseText decoding (text/html %3C!doctype%20html%3E%3Cmeta%20charset%3Dwindows-1252%3E%3Cx%3E%e6%a9%9f%3C%2Fx%3E  text) assert_equals: expected "<!doctype html><meta charset=windows-1252><x>機</x>" but got "<!doctype html><meta charset=windows-1252><x>機</x>"
+PASS XMLHttpRequest: responseText decoding (application/xml;charset=utf-8 %3C%3Fxml%20version%3D'1.0'%20encoding%3D'windows-1252'%3F%3E%3Cx%3E%e6%a9%9f%3C%2Fx%3E  text) 
+PASS XMLHttpRequest: responseText decoding (application/xml;charset=windows-1252 %3C%3Fxml%20version%3D'1.0'%20encoding%3D'windows-1252'%3F%3E%3Cx%3E%e6%a9%9f%3C%2Fx%3E  text) 
+PASS XMLHttpRequest: responseText decoding (text/html;charset=utf-8 %3C!doctype%20html%3E%3Cmeta%20charset%3Dwindows-1252%3E%3Cx%3E%e6%a9%9f%3C%2Fx%3E  text) 
+PASS XMLHttpRequest: responseText decoding (text/html;charset=windows-1252 %3C!doctype%20html%3E%3Cmeta%20charset%3Dwindows-1252%3E%3Cx%3E%e6%a9%9f%3C%2Fx%3E  text) 
+PASS XMLHttpRequest: responseText decoding (text/plain;charset=windows-1252 %FF  text) 
+PASS XMLHttpRequest: responseText decoding (text/plain %FF  text) 
+PASS XMLHttpRequest: responseText decoding (text/plain %FE%FF  text) 
+PASS XMLHttpRequest: responseText decoding (text/plain %FE%FF%FE%FF  text) 
+PASS XMLHttpRequest: responseText decoding (text/plain %EF%BB%BF  text) 
+PASS XMLHttpRequest: responseText decoding (text/plain %EF%BB%BF%EF%BB%BF  text) 
+PASS XMLHttpRequest: responseText decoding (text/plain %C2  text) 
+PASS XMLHttpRequest: responseText decoding (text/xml %FE%FF  text) 
+PASS XMLHttpRequest: responseText decoding (text/xml %FE%FF%FE%FF  text) 
+PASS XMLHttpRequest: responseText decoding (text/xml %EF%BB%BF  text) 
+PASS XMLHttpRequest: responseText decoding (text/xml %EF%BB%BF%EF%BB%BF  text) 
+PASS XMLHttpRequest: responseText decoding (text/plain %E3%81%B2  text) 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsetext-decoding.htm (223202 => 223203)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsetext-decoding.htm	2017-10-11 19:33:48 UTC (rev 223202)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsetext-decoding.htm	2017-10-11 19:40:31 UTC (rev 223203)
@@ -1,47 +1,92 @@
 <!doctype html>
 <html>
   <head>
+    <meta charset="utf-8">
     <title>XMLHttpRequest: responseText decoding</title>
     <script src=""
     <script src=""
-    <link rel="help" href="" data-tested-assertations="following::ol[1]/li[4]" />
-    <link rel="help" href="" data-tested-assertations="following::ol[1]/li[2] following::ol[1]/li[3] following::ol[1]/li[4] following::ol[1]/li[5]" />
   </head>
   <body>
-    <div id="log"></div>
     <script>
+      function create_html(content) {
+        return "<!doctype html><meta charset=windows-1252><x>" + content + "</x>";
+      }
+      function create_encoded_html(encoded_content) {
+        return encodeURIComponent("<!doctype html><meta charset=windows-1252><x>") + encoded_content + encodeURIComponent("<\/x>");
+      }
+      function create_xml(content) {
+        return "<?xml version='1.0' encoding='windows-1252'?><x>" + content + "</x>";
+      }
+      function create_encoded_xml(encoded_content) {
+        return encodeURIComponent("<?xml version='1.0' encoding='windows-1252'?><x>") + encoded_content + encodeURIComponent("<\/x>");
+      }
       function request(type, input, output, responseType) {
-        var test = async_test(document.title + " (" + type + " " + input + ")");
-        test.step(function() {
-          var client = new XMLHttpRequest()
+        async_test((test) => {
+          const client = new XMLHttpRequest();
           if (responseType !== undefined) {
-            client.responseType = responseType
+            client.responseType = responseType;
           }
-          client.open("GET", "resources/status.py?content=" + input + "&type=" + encodeURIComponent(type), true)
+          client.open("GET", "resources/status.py?content=" + input + "&type=" + encodeURIComponent(type), true);
           client._onload_ = test.step_func_done(() => {
-            assert_equals(client.responseText, output)
+            assert_equals(client.responseText, output);
           })
-          client.send(null)
-        })
+          client.send(null);
+        }, document.title + " (" + type + " " + input + " " + (responseType ? " " + responseType : "empty") + ")");
       }
-      request("application/xml", encodeURIComponent("<?xml version='1.0' encoding='windows-1252'?><x>")+'%FF'+encodeURIComponent("<\/x>"), "<?xml version='1.0' encoding='windows-1252'?><x>\u00FF<\/x>")
-      request("text/html", encodeURIComponent("<!doctype html><meta charset=windows-1252>")+"%FF", "<!doctype html><meta charset=windows-1252>\uFFFD")
-      request("text/plain;charset=windows-1252", "%FF", "\u00FF")
-      request("text/plain", "%FF", "\uFFFD")
-      request("text/plain", "%FE%FF", "")
-      request("text/plain", "%FE%FF%FE%FF", "\uFEFF")
-      request("text/plain", "%EF%BB%BF", "")
-      request("text/plain", "%EF%BB%BF%EF%BB%BF", "\uFEFF")
-      request("text/plain", "%C2", "\uFFFD")
-      request("text/xml", "%FE%FF", "")
-      request("text/xml", "%FE%FF%FE%FF", "\uFEFF")
-      request("text/xml", "%EF%BB%BF", "")
-      request("text/xml", "%EF%BB%BF%EF%BB%BF", "\uFEFF")
-      request("text/plain", "%E3%81%B2", "\u3072", 'text')
-      // the point of the following test: setting responseType=text should (per spec #text-response-entity-body point 3)
-      // skip some of the charset detection even for XML resources. The test uses a wilfully mislabelled XMLish response
-      // and the pass condition is that the responseType = text makes the decoder fall back to UTF-8
-      request("text/xml", encodeURIComponent("<?xml version='1.0' encoding='windows-1252'?><x>")+"%E3%81%B2"+encodeURIComponent("<\/x>"), "<?xml version='1.0' encoding='windows-1252'?><x>\u3072<\/x>", 'text')
+
+      const encoded_content = "%e6%a9%9f";
+      const decoded_as_windows_1252 = "\u00e6\u00a9\u0178";
+      const decoded_as_utf_8 = "\u6a5f";
+      const encoded_xml = create_encoded_xml(encoded_content);
+      const encoded_html = create_encoded_html(encoded_content);
+      const xml_decoded_as_windows_1252 = create_xml(decoded_as_windows_1252);
+      const xml_decoded_as_utf_8 = create_xml(decoded_as_utf_8);
+      const html_decoded_as_windows_1252 = create_html(decoded_as_windows_1252);
+      const html_decoded_as_utf_8 = create_html(decoded_as_utf_8);
+
+      // "default" response type
+      // An XML-ish response is sniffed.
+      request("application/xml", encoded_xml, xml_decoded_as_windows_1252);
+      // An HTML-ish response isn't sniffed.
+      request("text/html", encoded_html, html_decoded_as_utf_8);
+      request("application/xml;charset=utf-8", encoded_xml, xml_decoded_as_utf_8);
+      request("application/xml;charset=windows-1252", encoded_xml, xml_decoded_as_windows_1252);
+      request("text/html;charset=utf-8", encoded_html, html_decoded_as_utf_8);
+      request("text/html;charset=windows-1252", encoded_html, html_decoded_as_windows_1252);
+      request("text/plain;charset=windows-1252", "%FF", "\u00FF");
+      request("text/plain", "%FF", "\uFFFD");
+      request("text/plain", "%FE%FF", "");
+      request("text/plain", "%FE%FF%FE%FF", "\uFEFF");
+      request("text/plain", "%EF%BB%BF", "");
+      request("text/plain", "%EF%BB%BF%EF%BB%BF", "\uFEFF");
+      request("text/plain", "%C2", "\uFFFD");
+      request("text/xml", "%FE%FF", "");
+      request("text/xml", "%FE%FF%FE%FF", "\uFEFF");
+      request("text/xml", "%EF%BB%BF", "");
+      request("text/xml", "%EF%BB%BF%EF%BB%BF", "\uFEFF");
+      request("text/plain", "%E3%81%B2", "\u3072");
+
+      // "text" response type
+      // An XML-ish response isn't sniffed.
+      request("application/xml", encoded_xml, xml_decoded_as_utf_8, "text");
+      // An HTML-ish response isn't sniffed.
+      request("text/html", encoded_html, html_decoded_as_utf_8, "text");
+      request("application/xml;charset=utf-8", encoded_xml, xml_decoded_as_utf_8, "text");
+      request("application/xml;charset=windows-1252", encoded_xml, xml_decoded_as_windows_1252, "text");
+      request("text/html;charset=utf-8", encoded_html, html_decoded_as_utf_8, "text");
+      request("text/html;charset=windows-1252", encoded_html, html_decoded_as_windows_1252, "text");
+      request("text/plain;charset=windows-1252", "%FF", "\u00FF", "text");
+      request("text/plain", "%FF", "\uFFFD", "text");
+      request("text/plain", "%FE%FF", "", "text");
+      request("text/plain", "%FE%FF%FE%FF", "\uFEFF", "text");
+      request("text/plain", "%EF%BB%BF", "", "text");
+      request("text/plain", "%EF%BB%BF%EF%BB%BF", "\uFEFF", "text");
+      request("text/plain", "%C2", "\uFFFD", "text");
+      request("text/xml", "%FE%FF", "", "text");
+      request("text/xml", "%FE%FF%FE%FF", "\uFEFF", "text");
+      request("text/xml", "%EF%BB%BF", "", "text");
+      request("text/xml", "%EF%BB%BF%EF%BB%BF", "\uFEFF", "text");
+      request("text/plain", "%E3%81%B2", "\u3072", "text");
     </script>
   </body>
 </html>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-after-setting-document-domain-expected.txt (0 => 223203)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-after-setting-document-domain-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-after-setting-document-domain-expected.txt	2017-10-11 19:40:31 UTC (rev 223203)
@@ -0,0 +1,7 @@
+Blocked access to external URL http://www2.localhost:8800/XMLHttpRequest/resources/send-after-setting-document-domain-window-1.htm
+Blocked access to external URL http://www2.localhost:8800/XMLHttpRequest/resources/send-after-setting-document-domain-window-2.htm
+
+Harness Error (TIMEOUT), message = null
+
+TIMEOUT All tests ran Test timed out
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-after-setting-document-domain.htm (0 => 223203)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-after-setting-document-domain.htm	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-after-setting-document-domain.htm	2017-10-11 19:40:31 UTC (rev 223203)
@@ -0,0 +1,39 @@
+<!doctype html>
+<html>
+  <head>
+    <title>XMLHttpRequest: send() with document.domain set</title>
+    <script src=""
+    <script src=""
+    <link rel="help" href="" data-tested-assertations="following::ol[1]/li[2]/ol[1]/li[3]" />
+  </head>
+  <body>
+    <div id="log"></div>
+    <script>
+      var test_base_url = location.protocol+'//www2.'+location.host+"/XMLHttpRequest/resources/",
+          test_windows = [
+            window.open(test_base_url + "send-after-setting-document-domain-window-1.htm"),
+            window.open(test_base_url + "send-after-setting-document-domain-window-2.htm"),
+          ],
+          num_tests_left = test_windows.length;
+
+      async_test(function(wrapper_test) {
+        window.addEventListener("message", function(evt) {
+          // run a shadow test that just forwards the results
+          async_test(function(test) {
+            assert_true(evt.data.passed, evt.data.message);
+            test.done();
+          }, evt.data.name);
+
+          // after last result comes in, close all test
+          // windows and complete the wrapper test.
+          if (--num_tests_left == 0) {
+            for (var i=0; i<test_windows.length; ++i) {
+              test_windows[i].close();
+            }
+            wrapper_test.done();
+          }
+        }, false);
+      }, "All tests ran");
+    </script>
+  </body>
+</html>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-cors-expected.txt (0 => 223203)


--- 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-10-11 19:40:31 UTC (rev 223203)
@@ -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-not-enabled-expected.txt (0 => 223203)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-cors-not-enabled-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-cors-not-enabled-expected.txt	2017-10-11 19:40:31 UTC (rev 223203)
@@ -0,0 +1,5 @@
+Blocked access to external URL http://www1.localhost:8800/XMLHttpRequest/resources/auth1/auth.py
+CONSOLE MESSAGE: line 21: XMLHttpRequest cannot load http://www1.localhost:8800/XMLHttpRequest/resources/auth1/auth.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-not-enabled.htm (0 => 223203)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-cors-not-enabled.htm	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-cors-not-enabled.htm	2017-10-11 19:40:31 UTC (rev 223203)
@@ -0,0 +1,28 @@
+<!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=""
+    <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 = 'www1.'+location.host + location.pathname.replace(/\/[^\/]*$/, '/')
+        client.withCredentials = true
+        user = token()
+        client.open("GET", location.protocol+'//'+urlstart + "resources/auth1/auth.py", false, user, 'pass')
+        client.setRequestHeader("x-user", user)
+        assert_throws("NetworkError", function(){ client.send(null) })
+        assert_equals(client.responseText, '')
+        assert_equals(client.status, 0)
+        assert_equals(client.getResponseHeader('x-challenge'), null)
+      }, document.title)
+    </script>
+  </body>
+</html>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-cors.htm (0 => 223203)


--- 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-10-11 19:40:31 UTC (rev 223203)
@@ -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-expected.txt (0 => 223203)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-expected.txt	2017-10-11 19:40:31 UTC (rev 223203)
@@ -0,0 +1,3 @@
+
+PASS XMLHttpRequest: send() - "Basic" authenticated requests with user name and password passed to open() 
+Note: this test will only work as expected once per browsing session. Restart browser to re-test.

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-repeat-no-args-expected.txt (0 => 223203)


--- 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-10-11 19:40:31 UTC (rev 223203)
@@ -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 => 223203)


--- 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-10-11 19:40:31 UTC (rev 223203)
@@ -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-expected.txt (0 => 223203)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-setrequestheader-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-setrequestheader-expected.txt	2017-10-11 19:40:31 UTC (rev 223203)
@@ -0,0 +1,3 @@
+
+PASS XMLHttpRequest: send() - "Basic" authenticated request using setRequestHeader() 
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-setrequestheader.htm (0 => 223203)


--- 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-10-11 19:40:31 UTC (rev 223203)
@@ -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 => 223203)


--- 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-10-11 19:40:31 UTC (rev 223203)
@@ -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 => 223203)


--- 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-10-11 19:40:31 UTC (rev 223203)
@@ -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 => 223203)


--- 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-10-11 19:40:31 UTC (rev 223203)
@@ -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 => 223203)


--- 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-10-11 19:40:31 UTC (rev 223203)
@@ -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 => 223203)


--- 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-10-11 19:40:31 UTC (rev 223203)
@@ -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>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-network-error-async-events.sub-expected.txt (0 => 223203)


--- 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-10-11 19:40:31 UTC (rev 223203)
@@ -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 => 223203)


--- 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-10-11 19:40:31 UTC (rev 223203)
@@ -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/w3c-import.log (223202 => 223203)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/w3c-import.log	2017-10-11 19:33:48 UTC (rev 223202)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/w3c-import.log	2017-10-11 19:40:31 UTC (rev 223203)
@@ -20,6 +20,7 @@
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/XMLHttpRequest-withCredentials.any.js
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-after-receive.htm
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-after-send.htm
+/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-after-stop.htm
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-after-timeout.htm
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-during-done.htm
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-during-open.htm
@@ -84,6 +85,7 @@
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/anonymous-mode-unsupported.htm
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/data-uri.htm
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/event-abort.htm
+/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/event-error-order.sub.html
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/event-error.sub.html
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/event-load.htm
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/event-loadend.htm
@@ -92,6 +94,7 @@
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/event-progress.htm
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/event-readystate-sync-open.htm
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/event-readystatechange-loaded.htm
+/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/event-timeout-order.htm
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/event-timeout.htm
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/event-upload-progress-crossorigin.htm
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/event-upload-progress.htm
@@ -149,6 +152,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
@@ -159,6 +163,7 @@
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/overridemimetype-open-state-force-utf-8.htm
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/overridemimetype-open-state-force-xml.htm
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/overridemimetype-unsent-state-force-shiftjis.htm
+/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/preserve-ua-header-on-redirect.htm
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/progress-events-response-data-gzip.htm
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/response-data-arraybuffer.htm
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/response-data-blob.htm
@@ -171,6 +176,7 @@
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responseText-status.html
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responseType-document-in-worker.html
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responseXML-unavailable-in-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsedocument-decoding.htm
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsetext-decoding.htm
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responsetype.html
 /LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/responseurl.html
@@ -183,7 +189,15 @@
 /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-after-setting-document-domain.htm
+/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-cors-not-enabled.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-existing-session.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
@@ -197,6 +211,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
@@ -203,6 +218,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
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to