Title: [203408] trunk/LayoutTests/imported/w3c
Revision
203408
Author
[email protected]
Date
2016-07-19 09:08:56 -0700 (Tue, 19 Jul 2016)

Log Message

Refresh WPT tests up to 98ec1ad
https://bugs.webkit.org/show_bug.cgi?id=159879

Patch by Youenn Fablet <[email protected]> on 2016-07-19
Reviewed by Alex Christensen.

This refresh concerns fetch API tests with a number of test fixes.
Rebasing both window and worker expectations.

* resources/TestRepositories:
* web-platform-tests/fetch/api/basic/mode-same-origin-expected.txt:
* web-platform-tests/fetch/api/basic/mode-same-origin-worker-expected.txt:
* web-platform-tests/fetch/api/basic/mode-same-origin-worker.html:
* web-platform-tests/fetch/api/basic/mode-same-origin.html:
* web-platform-tests/fetch/api/basic/mode-same-origin.js:
* web-platform-tests/fetch/api/cors/cors-basic-worker.html:
* web-platform-tests/fetch/api/cors/cors-basic.html:
* web-platform-tests/fetch/api/cors/cors-basic.js:
(cors):
* web-platform-tests/fetch/api/cors/cors-cookies-expected.txt:
* web-platform-tests/fetch/api/cors/cors-cookies-worker-expected.txt:
* web-platform-tests/fetch/api/cors/cors-cookies-worker.html:
* web-platform-tests/fetch/api/cors/cors-cookies.html:
* web-platform-tests/fetch/api/cors/cors-cookies.js:
(corsCookies):
* web-platform-tests/fetch/api/cors/cors-no-preflight-worker.html:
* web-platform-tests/fetch/api/cors/cors-no-preflight.html:
* web-platform-tests/fetch/api/cors/cors-no-preflight.js:
(corsNoPreflight):
* web-platform-tests/fetch/api/cors/cors-origin-worker.html:
* web-platform-tests/fetch/api/cors/cors-origin.html:
* web-platform-tests/fetch/api/cors/cors-origin.js:
(corsOrigin):
* web-platform-tests/fetch/api/cors/cors-preflight-redirect-worker.html:
* web-platform-tests/fetch/api/cors/cors-preflight-redirect.html:
* web-platform-tests/fetch/api/cors/cors-preflight-redirect.js:
* web-platform-tests/fetch/api/cors/cors-preflight-referrer-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker.html:
* web-platform-tests/fetch/api/cors/cors-preflight-referrer.html:
* web-platform-tests/fetch/api/cors/cors-preflight-referrer.js:
(corsPreflightReferrer):
* web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html:
* web-platform-tests/fetch/api/cors/cors-preflight-status.html:
* web-platform-tests/fetch/api/cors/cors-preflight-status.js:
* web-platform-tests/fetch/api/cors/cors-redirect-credentials.html:
* web-platform-tests/fetch/api/cors/cors-redirect-credentials.js:
* web-platform-tests/fetch/api/cors/cors-redirect-worker.html:
* web-platform-tests/fetch/api/cors/cors-redirect.html:
* web-platform-tests/fetch/api/cors/cors-redirect.js:
* web-platform-tests/fetch/api/request/request-cache.html:
* web-platform-tests/fetch/api/request/resources/w3c-import.log:
* web-platform-tests/fetch/api/resources/get-host-info.sub.js: Added.
(get_host_info):
* web-platform-tests/fetch/api/resources/utils.js:
(validateBufferFromString):
* web-platform-tests/fetch/api/resources/w3c-import.log:
* web-platform-tests/fetch/api/response/response-clone-expected.txt:
* web-platform-tests/fetch/api/response/response-clone.html:
* web-platform-tests/fetch/api/response/response-consume-stream-expected.txt:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2016-07-19 16:08:56 UTC (rev 203408)
@@ -1,3 +1,65 @@
+2016-07-19  Youenn Fablet  <[email protected]>
+
+        Refresh WPT tests up to 98ec1ad
+        https://bugs.webkit.org/show_bug.cgi?id=159879
+
+        Reviewed by Alex Christensen.
+
+        This refresh concerns fetch API tests with a number of test fixes.
+        Rebasing both window and worker expectations.
+
+        * resources/TestRepositories:
+        * web-platform-tests/fetch/api/basic/mode-same-origin-expected.txt:
+        * web-platform-tests/fetch/api/basic/mode-same-origin-worker-expected.txt:
+        * web-platform-tests/fetch/api/basic/mode-same-origin-worker.html:
+        * web-platform-tests/fetch/api/basic/mode-same-origin.html:
+        * web-platform-tests/fetch/api/basic/mode-same-origin.js:
+        * web-platform-tests/fetch/api/cors/cors-basic-worker.html:
+        * web-platform-tests/fetch/api/cors/cors-basic.html:
+        * web-platform-tests/fetch/api/cors/cors-basic.js:
+        (cors):
+        * web-platform-tests/fetch/api/cors/cors-cookies-expected.txt:
+        * web-platform-tests/fetch/api/cors/cors-cookies-worker-expected.txt:
+        * web-platform-tests/fetch/api/cors/cors-cookies-worker.html:
+        * web-platform-tests/fetch/api/cors/cors-cookies.html:
+        * web-platform-tests/fetch/api/cors/cors-cookies.js:
+        (corsCookies):
+        * web-platform-tests/fetch/api/cors/cors-no-preflight-worker.html:
+        * web-platform-tests/fetch/api/cors/cors-no-preflight.html:
+        * web-platform-tests/fetch/api/cors/cors-no-preflight.js:
+        (corsNoPreflight):
+        * web-platform-tests/fetch/api/cors/cors-origin-worker.html:
+        * web-platform-tests/fetch/api/cors/cors-origin.html:
+        * web-platform-tests/fetch/api/cors/cors-origin.js:
+        (corsOrigin):
+        * web-platform-tests/fetch/api/cors/cors-preflight-redirect-worker.html:
+        * web-platform-tests/fetch/api/cors/cors-preflight-redirect.html:
+        * web-platform-tests/fetch/api/cors/cors-preflight-redirect.js:
+        * web-platform-tests/fetch/api/cors/cors-preflight-referrer-expected.txt:
+        * web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker-expected.txt:
+        * web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker.html:
+        * web-platform-tests/fetch/api/cors/cors-preflight-referrer.html:
+        * web-platform-tests/fetch/api/cors/cors-preflight-referrer.js:
+        (corsPreflightReferrer):
+        * web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html:
+        * web-platform-tests/fetch/api/cors/cors-preflight-status.html:
+        * web-platform-tests/fetch/api/cors/cors-preflight-status.js:
+        * web-platform-tests/fetch/api/cors/cors-redirect-credentials.html:
+        * web-platform-tests/fetch/api/cors/cors-redirect-credentials.js:
+        * web-platform-tests/fetch/api/cors/cors-redirect-worker.html:
+        * web-platform-tests/fetch/api/cors/cors-redirect.html:
+        * web-platform-tests/fetch/api/cors/cors-redirect.js:
+        * web-platform-tests/fetch/api/request/request-cache.html:
+        * web-platform-tests/fetch/api/request/resources/w3c-import.log:
+        * web-platform-tests/fetch/api/resources/get-host-info.sub.js: Added.
+        (get_host_info):
+        * web-platform-tests/fetch/api/resources/utils.js:
+        (validateBufferFromString):
+        * web-platform-tests/fetch/api/resources/w3c-import.log:
+        * web-platform-tests/fetch/api/response/response-clone-expected.txt:
+        * web-platform-tests/fetch/api/response/response-clone.html:
+        * web-platform-tests/fetch/api/response/response-consume-stream-expected.txt:
+
 2016-07-19  Youenn Fablet  <[email protected]>
 
         [Streams API] Make ReadableStream properties not enumerable

Modified: trunk/LayoutTests/imported/w3c/resources/TestRepositories (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/resources/TestRepositories	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/resources/TestRepositories	2016-07-19 16:08:56 UTC (rev 203408)
@@ -15,7 +15,7 @@
     {
         "name": "web-platform-tests",
         "url": "https://github.com/w3c/web-platform-tests.git", 
-        "revision": "c875b42",
+        "revision": "98ec1ad",
         "paths_to_skip": [
             "conformance-checkers",
             "docs",

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin-expected.txt (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin-expected.txt	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin-expected.txt	2016-07-19 16:08:56 UTC (rev 203408)
@@ -2,5 +2,5 @@
 PASS Fetch ../resources/top.txt with same-origin mode 
 PASS Fetch http://localhost:8800/fetch/api/resources/top.txt with same-origin mode 
 PASS Fetch https://localhost:9443/fetch/api/resources/top.txt with same-origin mode 
-PASS Fetch http://www.localhost:8800/fetch/api/resources/top.txt with same-origin mode 
+PASS Fetch http://127.0.0.1:8800/fetch/api/resources/top.txt with same-origin mode 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin-worker-expected.txt (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin-worker-expected.txt	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin-worker-expected.txt	2016-07-19 16:08:56 UTC (rev 203408)
@@ -2,5 +2,5 @@
 PASS Fetch ../resources/top.txt with same-origin mode 
 PASS Fetch http://localhost:8800/fetch/api/resources/top.txt with same-origin mode 
 PASS Fetch https://localhost:9443/fetch/api/resources/top.txt with same-origin mode 
-PASS Fetch http://www.localhost:8800/fetch/api/resources/top.txt with same-origin mode 
+PASS Fetch http://127.0.0.1:8800/fetch/api/resources/top.txt with same-origin mode 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin-worker.html (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin-worker.html	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin-worker.html	2016-07-19 16:08:56 UTC (rev 203408)
@@ -11,7 +11,7 @@
   </head>
   <body>
     <script>
-      fetch_tests_from_worker(new Worker("mode-same-origin.js?pipe=sub"));
+      fetch_tests_from_worker(new Worker("mode-same-origin.js"));
     </script>
   </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin.html (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin.html	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin.html	2016-07-19 16:08:56 UTC (rev 203408)
@@ -11,6 +11,7 @@
   </head>
   <body>
     <script src=""
-    <script src=""
+    <script src=""
+    <script src=""
   </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin.js (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin.js	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin.js	2016-07-19 16:08:56 UTC (rev 203408)
@@ -1,6 +1,7 @@
 if (this.document === undefined) {
   importScripts("/resources/testharness.js");
   importScripts("../resources/utils.js");
+  importScripts("../resources/get-host-info.sub.js")
 }
 
 function fetchSameOrigin(url, shouldPass) {
@@ -15,10 +16,12 @@
   }, "Fetch "+ url + " with same-origin mode");
 }
 
+var host_info = get_host_info();
+
 fetchSameOrigin(RESOURCES_DIR + "top.txt", true);
-fetchSameOrigin("http://{{host}}:{{ports[http][0]}}/fetch/api/resources/top.txt", true);
-fetchSameOrigin("https://{{host}}:{{ports[https][0]}}/fetch/api/resources/top.txt", false);
-fetchSameOrigin("http://{{domains[www]}}:{{ports[http][0]}}/fetch/api/resources/top.txt", false);
+fetchSameOrigin(host_info.HTTP_ORIGIN + "/fetch/api/resources/top.txt", true);
+fetchSameOrigin(host_info.HTTPS_ORIGIN + "/fetch/api/resources/top.txt", false);
+fetchSameOrigin(host_info.HTTP_REMOTE_ORIGIN + "/fetch/api/resources/top.txt", false);
 
 done();
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-worker.html (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-worker.html	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-worker.html	2016-07-19 16:08:56 UTC (rev 203408)
@@ -13,7 +13,7 @@
   </head>
   <body>
     <script>
-      fetch_tests_from_worker(new Worker("cors-basic.js?pipe=sub"));
+      fetch_tests_from_worker(new Worker("cors-basic.js"));
     </script>
   </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.html (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.html	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.html	2016-07-19 16:08:56 UTC (rev 203408)
@@ -13,6 +13,7 @@
   </head>
   <body>
     <script src=""
-    <script src=""
+    <script src=""
+    <script src=""
   </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.js (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.js	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.js	2016-07-19 16:08:56 UTC (rev 203408)
@@ -1,17 +1,11 @@
 if (this.document === undefined) {
   importScripts("/resources/testharness.js");
   importScripts("../resources/utils.js");
+  importScripts("../resources/get-host-info.sub.js");
 }
 
-function cors(desc, scheme, subdomain, port) {
-  if (!port)
-    port = location.port;
-  if (subdomain)
-    subdomain = subdomain + ".";
-  else
-    subdomain = "";
-
-  var url = "" + "://" + subdomain + "{{host}}" + ":" + port + dirname(location.pathname);
+function cors(desc, origin) {
+  var url = "" + dirname(location.pathname);
   var urlParameters = "?pipe=header(Access-Control-Allow-Origin,*)";
 
   promise_test(function(test) {
@@ -36,10 +30,12 @@
   }, desc + " [cors mode]");
 }
 
-cors("Same domain different port", "http", undefined, "{{ports[http][1]}}");
-cors("Same domain different protocol different port", "https", undefined, "{{ports[https][0]}}");
-cors("Cross domain basic usage", "http", "www1");
-cors("Cross domain different port", "http", "www1", "{{ports[http][1]}}");
-cors("Cross domain different protocol", "https", "www1", "{{ports[https][0]}}");
+var host_info = get_host_info();
 
+cors("Same domain different port", host_info.HTTP_ORIGIN_WITH_DIFFERENT_PORT);
+cors("Same domain different protocol different port", host_info.HTTPS_ORIGIN);
+cors("Cross domain basic usage", host_info.HTTP_REMOTE_ORIGIN);
+cors("Cross domain different port", host_info.HTTP_REMOTE_ORIGIN_WITH_DIFFERENT_PORT);
+cors("Cross domain different protocol", host_info.HTTPS_REMOTE_ORIGIN);
+
 done();

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-expected.txt (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-expected.txt	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-expected.txt	2016-07-19 16:08:56 UTC (rev 203408)
@@ -3,6 +3,6 @@
 FAIL Include mode: 1 cookie promise_test: Unhandled rejection with value: object "TypeError: Type error"
 FAIL Include mode: local cookies are not sent with remote request promise_test: Unhandled rejection with value: object "TypeError: Type error"
 FAIL Include mode: remote cookies are not sent with local request promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL Same-origin mode: cookies are discarded in cors request promise_test: Unhandled rejection with value: object "TypeError: Type error"
 FAIL Include mode: remote cookies are not sent with other remote request promise_test: Unhandled rejection with value: object "TypeError: Type error"
-FAIL Same-origin mode: cookies are discarded in cors request promise_test: Unhandled rejection with value: object "TypeError: Type error"
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-worker-expected.txt (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-worker-expected.txt	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-worker-expected.txt	2016-07-19 16:08:56 UTC (rev 203408)
@@ -3,6 +3,6 @@
 FAIL Include mode: 1 cookie promise_test: Unhandled rejection with value: object "TypeError: Type error"
 FAIL Include mode: local cookies are not sent with remote request promise_test: Unhandled rejection with value: object "TypeError: Type error"
 FAIL Include mode: remote cookies are not sent with local request promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL Same-origin mode: cookies are discarded in cors request promise_test: Unhandled rejection with value: object "TypeError: Type error"
 FAIL Include mode: remote cookies are not sent with other remote request promise_test: Unhandled rejection with value: object "TypeError: Type error"
-FAIL Same-origin mode: cookies are discarded in cors request promise_test: Unhandled rejection with value: object "TypeError: Type error"
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-worker.html (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-worker.html	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-worker.html	2016-07-19 16:08:56 UTC (rev 203408)
@@ -12,7 +12,7 @@
   </head>
   <body>
     <script>
-      fetch_tests_from_worker(new Worker("cors-cookies.js?pipe=sub"));
+      fetch_tests_from_worker(new Worker("cors-cookies.js"));
     </script>
   </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies.html (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies.html	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies.html	2016-07-19 16:08:56 UTC (rev 203408)
@@ -12,6 +12,7 @@
   </head>
   <body>
     <script src=""
-    <script src=""
+    <script src=""
+    <script src=""
   </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies.js (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies.js	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies.js	2016-07-19 16:08:56 UTC (rev 203408)
@@ -1,11 +1,12 @@
 if (this.document === undefined) {
   importScripts("/resources/testharness.js");
   importScripts("../resources/utils.js");
+  importScripts("../resources/get-host-info.sub.js")
 }
 
-function corsCookies(desc, domain1, domain2, credentialsMode, cookies) {
-  var urlSetCookie = "http://" + domain1 + ":{{ports[http][0]}}" + dirname(location.pathname) + RESOURCES_DIR + "top.txt";
-  var urlCheckCookies = "http://" + domain2 + ":{{ports[http][0]}}" + dirname(location.pathname) + RESOURCES_DIR + "inspect-headers.py?cors&headers=cookie";
+function corsCookies(desc, baseURL1, baseURL2, credentialsMode, cookies) {
+  var urlSetCookie = baseURL1 + dirname(location.pathname) + RESOURCES_DIR + "top.txt";
+  var urlCheckCookies = baseURL2 + dirname(location.pathname) + RESOURCES_DIR + "inspect-headers.py?cors&headers=cookie";
   //enable cors with credentials
   var urlParameters = "?pipe=header(Access-Control-Allow-Origin," + location.origin + ")";
   urlParameters += "|header(Access-Control-Allow-Credentials,true)";
@@ -29,7 +30,7 @@
     }).then(function(resp) {
       assert_equals(resp.status, 200, "HTTP status is 200");
       assert_false(resp.headers.has("Cookie") , "Cookie header is not exposed in response");
-      if (credentialsMode === "include" && domain1 === domain2) {
+      if (credentialsMode === "include" && baseURL1 === baseURL2) {
         assert_equals(resp.headers.get("x-request-cookie") , cookies.join("; "), "Request includes cookie(s)");
       }
       else {
@@ -44,15 +45,16 @@
   }, desc);
 }
 
-var local = "{{host}}";
-var remote = "www.{{host}}";
-var remote1 = "www1.{{host}}";
+var local = get_host_info().HTTP_ORIGIN;
+var remote = get_host_info().HTTP_REMOTE_ORIGIN;
+// FIXME: otherRemote might not be accessible on some test environments.
+var otherRemote = "www." + local;
 
 corsCookies("Omit mode: no cookie sent", local, local, "omit", ["g=7"]);
 corsCookies("Include mode: 1 cookie", remote, remote, "include", ["a=1"]);
 corsCookies("Include mode: local cookies are not sent with remote request", local, remote, "include", ["c=3"]);
 corsCookies("Include mode: remote cookies are not sent with local request", remote, local, "include", ["d=4"]);
-corsCookies("Include mode: remote cookies are not sent with other remote request", remote, remote1, "include", ["e=5"]);
 corsCookies("Same-origin mode: cookies are discarded in cors request", remote, remote, "same-origin", ["f=6"]);
+corsCookies("Include mode: remote cookies are not sent with other remote request", remote, otherRemote, "include", ["e=5"]);
 
 done();

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight-worker.html (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight-worker.html	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight-worker.html	2016-07-19 16:08:56 UTC (rev 203408)
@@ -14,7 +14,7 @@
   </head>
   <body>
     <script>
-      fetch_tests_from_worker(new Worker("cors-no-preflight.js?pipe=sub"));
+      fetch_tests_from_worker(new Worker("cors-no-preflight.js"));
     </script>
   </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.html (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.html	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.html	2016-07-19 16:08:56 UTC (rev 203408)
@@ -15,6 +15,7 @@
   <body>
     <script src=""
     <script src=""
-    <script src=""
+    <script src=""
+    <script src=""
   </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.js (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.js	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.js	2016-07-19 16:08:56 UTC (rev 203408)
@@ -1,19 +1,14 @@
 if (this.document === undefined) {
+  importScripts("/common/utils.js");
   importScripts("/resources/testharness.js");
-  importScripts("/common/utils.js");
   importScripts("../resources/utils.js");
+  importScripts("../resources/get-host-info.sub.js")
 }
 
-function corsNoPreflight(desc, scheme, subdomain, port, method, headerName, headerValue) {
-  if (!port)
-    port = location.port;
-  if (subdomain)
-    subdomain = subdomain + ".";
-  else
-    subdomain = "";
+function corsNoPreflight(desc, baseURL, method, headerName, headerValue) {
 
   var uuid_token = token();
-  var url = "" + "://" + subdomain + "{{host}}" + ":" + port + dirname(location.pathname) + RESOURCES_DIR + "preflight.py";
+  var url = "" + dirname(location.pathname) + RESOURCES_DIR + "preflight.py";
   var urlParameters = "?token=" + uuid_token + "&max_age=0";
   var requestInit = {"mode": "cors", "method": method, "headers":{}};
   if (headerName)
@@ -29,22 +24,22 @@
     });
   }, desc);
 }
-var port2 = "{{ports[http][1]}}";
-var httpsPort = "{{ports[https][0]}}";
 
-corsNoPreflight("Cross domain basic usage [GET]", "http", "www1", undefined, "GET");
-corsNoPreflight("Same domain different port [GET]", "http", undefined, port2, "GET");
-corsNoPreflight("Cross domain different port [GET]", "http", "www1", port2, "GET");
-corsNoPreflight("Cross domain different protocol [GET]", "https", "www1", httpsPort, "GET");
-corsNoPreflight("Same domain different protocol different port [GET]", "https", undefined, httpsPort, "GET");
-corsNoPreflight("Cross domain [POST]", "http", "www1", undefined, "POST");
-corsNoPreflight("Cross domain [HEAD]", "http", "www1", undefined, "HEAD");
-corsNoPreflight("Cross domain [GET] [Accept: */*]", "http", "www1", undefined, "GET" , "Accept", "*/*");
-corsNoPreflight("Cross domain [GET] [Accept-Language: fr]", "http", "www1", undefined, "GET" , "Accept-Language", "fr");
-corsNoPreflight("Cross domain [GET] [Content-Language: fr]", "http", "www1", undefined, "GET" , "Content-Language", "fr");
-corsNoPreflight("Cross domain [GET] [Content-Type: application/x-www-form-urlencoded]", "http", "www1", undefined, "GET" , "Content-Type", "application/x-www-form-urlencoded");
-corsNoPreflight("Cross domain [GET] [Content-Type: multipart/form-data]", "http", "www1", undefined, "GET" , "Content-Type", "multipart/form-data");
-corsNoPreflight("Cross domain [GET] [Content-Type: text/plain]", "http", "www1", undefined, "GET" , "Content-Type", "text/plain");
-corsNoPreflight("Cross domain [GET] [Content-Type: text/plain;charset=utf-8]", "http", "www1", undefined, "GET" , "Content-Type", "text/plain;charset=utf-8");
+var host_info = get_host_info();
 
+corsNoPreflight("Cross domain basic usage [GET]", host_info.HTTP_REMOTE_ORIGIN, "GET");
+corsNoPreflight("Same domain different port [GET]", host_info.HTTP_ORIGIN_WITH_DIFFERENT_ORIGIN, "GET");
+corsNoPreflight("Cross domain different port [GET]", host_info.HTTP_REMOTE_ORIGIN_WITH_DIFFERENT_ORIGIN, "GET");
+corsNoPreflight("Cross domain different protocol [GET]", host_info.HTTPS_REMOTE_ORIGIN, "GET");
+corsNoPreflight("Same domain different protocol different port [GET]", host_info.HTTPS_ORIGIN, "GET");
+corsNoPreflight("Cross domain [POST]", host_info.HTTP_REMOTE_ORIGIN, "POST");
+corsNoPreflight("Cross domain [HEAD]", host_info.HTTP_REMOTE_ORIGIN, "HEAD");
+corsNoPreflight("Cross domain [GET] [Accept: */*]", host_info.HTTP_REMOTE_ORIGIN, "GET" , "Accept", "*/*");
+corsNoPreflight("Cross domain [GET] [Accept-Language: fr]", host_info.HTTP_REMOTE_ORIGIN, "GET" , "Accept-Language", "fr");
+corsNoPreflight("Cross domain [GET] [Content-Language: fr]", host_info.HTTP_REMOTE_ORIGIN, "GET" , "Content-Language", "fr");
+corsNoPreflight("Cross domain [GET] [Content-Type: application/x-www-form-urlencoded]", host_info.HTTP_REMOTE_ORIGIN, "GET" , "Content-Type", "application/x-www-form-urlencoded");
+corsNoPreflight("Cross domain [GET] [Content-Type: multipart/form-data]", host_info.HTTP_REMOTE_ORIGIN, "GET" , "Content-Type", "multipart/form-data");
+corsNoPreflight("Cross domain [GET] [Content-Type: text/plain]", host_info.HTTP_REMOTE_ORIGIN, "GET" , "Content-Type", "text/plain");
+corsNoPreflight("Cross domain [GET] [Content-Type: text/plain;charset=utf-8]", host_info.HTTP_REMOTE_ORIGIN, "GET" , "Content-Type", "text/plain;charset=utf-8");
+
 done();

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin-worker.html (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin-worker.html	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin-worker.html	2016-07-19 16:08:56 UTC (rev 203408)
@@ -13,7 +13,7 @@
   </head>
   <body>
     <script>
-      fetch_tests_from_worker(new Worker("cors-origin.js?pipe=sub"));
+      fetch_tests_from_worker(new Worker("cors-origin.js"));
     </script>
   </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.html (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.html	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.html	2016-07-19 16:08:56 UTC (rev 203408)
@@ -14,6 +14,7 @@
   <body>
     <script src=""
     <script src=""
-    <script src=""
+    <script src=""
+    <script src=""
   </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.js (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.js	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.js	2016-07-19 16:08:56 UTC (rev 203408)
@@ -1,23 +1,18 @@
 if (this.document === undefined) {
+  importScripts("/common/utils.js");
   importScripts("/resources/testharness.js");
   importScripts("../resources/utils.js");
-  importScripts("/common/utils.js");
+  importScripts("../resources/get-host-info.sub.js")
 }
 
 /* If origin is undefined, it is set to fetched url's origin*/
-function corsOrigin(desc, scheme, subdomain, port, method, origin, shouldPass) {
-  if (!port)
-    port = location.port;
-  if (subdomain)
-    subdomain = subdomain + ".";
-  else
-    subdomain = "";
+function corsOrigin(desc, baseURL, method, origin, shouldPass) {
   if (!origin)
-    origin = scheme + "://" + subdomain + "{{host}}" + ":" + port;
+    origin = baseURL;
 
   var uuid_token = token();
   var urlParameters = "?token=" + uuid_token + "&max_age=0&origin=" + encodeURIComponent(origin) + "&allow_methods=" + method;
-  var url = "" + "://" + subdomain + "{{host}}" + ":" + port + dirname(location.pathname) + RESOURCES_DIR + "preflight.py";
+  var url = "" + dirname(location.pathname) + RESOURCES_DIR + "preflight.py";
   var requestInit = {"mode": "cors", "method": method};
 
   promise_test(function(test) {
@@ -34,28 +29,28 @@
   }, desc);
 
 }
-var port = "{{ports[http][0]}}";
-var port2 = "{{ports[http][1]}}";
-var httpsPort = "{{ports[https][0]}}";
+
+var host_info = get_host_info();
+
 /* Actual origin */
-var origin = "http://{{host}}:{{ports[http][0]}}";
+var origin = host_info.HTTP_ORIGIN;
 
-corsOrigin("Cross domain different subdomain [origin OK]", "http", "www1", undefined, "GET", origin, true);
-corsOrigin("Cross domain different subdomain [origin KO]", "http", "www1", undefined, "GET", undefined, false);
-corsOrigin("Same domain different port [origin OK]", "http", undefined, port2, "GET", origin, true);
-corsOrigin("Same domain different port [origin KO]", "http", undefined, port2, "GET", undefined, false);
-corsOrigin("Cross domain different port [origin OK]", "http", "www1", port2, "GET", origin, true);
-corsOrigin("Cross domain different port [origin KO]", "http", "www1", port2, "GET", undefined, false);
-corsOrigin("Cross domain different protocol [origin OK]", "https", "www1", httpsPort, "GET", origin, true);
-corsOrigin("Cross domain different protocol [origin KO]", "https", "www1", httpsPort, "GET", undefined, false);
-corsOrigin("Same domain different protocol different port [origin OK]", "https", undefined, httpsPort, "GET", origin, true);
-corsOrigin("Same domain different protocol different port [origin KO]", "https", undefined, httpsPort, "GET", undefined, false);
-corsOrigin("Cross domain [POST] [origin OK]", "http", "www1", undefined, "POST", origin, true);
-corsOrigin("Cross domain [POST] [origin KO]", "http", "www1", undefined, "POST", undefined, false);
-corsOrigin("Cross domain [HEAD] [origin OK]", "http", "www1", undefined, "HEAD", origin, true);
-corsOrigin("Cross domain [HEAD] [origin KO]", "http", "www1", undefined, "HEAD", undefined, false);
-corsOrigin("CORS preflight [PUT] [origin OK]", "http", "www1", undefined, "PUT", origin, true);
-corsOrigin("CORS preflight [PUT] [origin KO]", "http", "www1", undefined, "PUT", undefined, false);
-corsOrigin("Allowed origin: \"\" [origin KO]", "http", "www1", undefined, "GET", "" , false);
+corsOrigin("Cross domain different subdomain [origin OK]", host_info.HTTP_REMOTE_ORIGIN, "GET", origin, true);
+corsOrigin("Cross domain different subdomain [origin KO]", host_info.HTTP_REMOTE_ORIGIN, "GET", undefined, false);
+corsOrigin("Same domain different port [origin OK]", host_info.HTTP_ORIGIN_WITH_DIFFERENT_PORT, "GET", origin, true);
+corsOrigin("Same domain different port [origin KO]", host_info.HTTP_ORIGIN_WITH_DIFFERENT_PORT, "GET", undefined, false);
+corsOrigin("Cross domain different port [origin OK]", host_info.HTTP_REMOTE_ORIGIN_WITH_DIFFERENT_PORT, "GET", origin, true);
+corsOrigin("Cross domain different port [origin KO]", host_info.HTTP_REMOTE_ORIGIN_WITH_DIFFERENT_PORT, "GET", undefined, false);
+corsOrigin("Cross domain different protocol [origin OK]", host_info.HTTPS_REMOTE_ORIGIN, "GET", origin, true);
+corsOrigin("Cross domain different protocol [origin KO]", host_info.HTTPS_REMOTE_ORIGIN, "GET", undefined, false);
+corsOrigin("Same domain different protocol different port [origin OK]", host_info.HTTPS_ORIGIN, "GET", origin, true);
+corsOrigin("Same domain different protocol different port [origin KO]", host_info.HTTPS_ORIGIN, "GET", undefined, false);
+corsOrigin("Cross domain [POST] [origin OK]", host_info.HTTP_REMOTE_ORIGIN, "POST", origin, true);
+corsOrigin("Cross domain [POST] [origin KO]", host_info.HTTP_REMOTE_ORIGIN, "POST", undefined, false);
+corsOrigin("Cross domain [HEAD] [origin OK]", host_info.HTTP_REMOTE_ORIGIN, "HEAD", origin, true);
+corsOrigin("Cross domain [HEAD] [origin KO]", host_info.HTTP_REMOTE_ORIGIN, "HEAD", undefined, false);
+corsOrigin("CORS preflight [PUT] [origin OK]", host_info.HTTP_REMOTE_ORIGIN, "PUT", origin, true);
+corsOrigin("CORS preflight [PUT] [origin KO]", host_info.HTTP_REMOTE_ORIGIN, "PUT", undefined, false);
+corsOrigin("Allowed origin: \"\" [origin KO]", host_info.HTTP_REMOTE_ORIGIN, "GET", "" , false);
 
 done();

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect-worker.html (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect-worker.html	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect-worker.html	2016-07-19 16:08:56 UTC (rev 203408)
@@ -12,7 +12,7 @@
   </head>
   <body>
     <script>
-      fetch_tests_from_worker(new Worker("cors-preflight-redirect.js?pipe=sub"));
+      fetch_tests_from_worker(new Worker("cors-preflight-redirect.js"));
     </script>
   </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect.html (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect.html	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect.html	2016-07-19 16:08:56 UTC (rev 203408)
@@ -13,6 +13,7 @@
   <body>
     <script src=""
     <script src=""
-    <script src=""
+    <script src=""
+    <script src=""
   </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect.js (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect.js	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect.js	2016-07-19 16:08:56 UTC (rev 203408)
@@ -2,6 +2,7 @@
   importScripts("/resources/testharness.js");
   importScripts("../resources/utils.js");
   importScripts("/common/utils.js");
+  importScripts("../resources/get-host-info.sub.js");
 }
 
 function corsPreflightRedirect(desc, redirectUrl, redirectLocation, redirectStatus, redirectPreflight) {
@@ -27,8 +28,8 @@
   }, desc);
 }
 
-var redirectUrl = "http://www1.{{host}}:{{ports[http][0]}}" + dirname(location.pathname) + RESOURCES_DIR + "redirect.py";
-var locationUrl = "http://www1.{{host}}:{{ports[http][0]}}" + dirname(location.pathname) + RESOURCES_DIR + "preflight.py";
+var redirectUrl = get_host_info().HTTP_REMOTE_ORIGIN + dirname(location.pathname) + RESOURCES_DIR + "redirect.py";
+var locationUrl =  get_host_info().HTTP_REMOTE_ORIGIN + dirname(location.pathname) + RESOURCES_DIR + "preflight.py";
 
 for (var code of [301, 302, 303, 307, 308]) {
   /* preflight should not follow the redirection */

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer-expected.txt (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer-expected.txt	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer-expected.txt	2016-07-19 16:08:56 UTC (rev 203408)
@@ -1,7 +1,9 @@
 
-PASS Referrer policy: no-referrer 
-PASS Referrer policy: "" 
-PASS Referrer policy: origin 
-PASS Referrer policy: origin-when-cross-origin 
-PASS Referrer policy: unsafe-url 
+Harness Error (TIMEOUT), message = null
 
+FAIL Referrer policy: no-referrer assert_equals: Clean stash response's status is 200 expected 200 but got 500
+TIMEOUT Referrer policy: "" Test timed out
+TIMEOUT Referrer policy: origin Test timed out
+TIMEOUT Referrer policy: origin-when-cross-origin Test timed out
+TIMEOUT Referrer policy: unsafe-url Test timed out
+

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker-expected.txt (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker-expected.txt	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker-expected.txt	2016-07-19 16:08:56 UTC (rev 203408)
@@ -1,7 +1,9 @@
 
-PASS Referrer policy: no-referrer 
-PASS Referrer policy: "" 
-PASS Referrer policy: origin 
-PASS Referrer policy: origin-when-cross-origin 
-PASS Referrer policy: unsafe-url 
+Harness Error (TIMEOUT), message = null
 
+FAIL Referrer policy: no-referrer assert_equals: Clean stash response's status is 200 expected 200 but got 500
+TIMEOUT Referrer policy: "" Test timed out
+TIMEOUT Referrer policy: origin Test timed out
+TIMEOUT Referrer policy: origin-when-cross-origin Test timed out
+TIMEOUT Referrer policy: unsafe-url Test timed out
+

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker.html (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker.html	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker.html	2016-07-19 16:08:56 UTC (rev 203408)
@@ -12,7 +12,7 @@
   </head>
   <body>
     <script>
-      fetch_tests_from_worker(new Worker("cors-preflight-referrer.js?pipe=sub"));
+      fetch_tests_from_worker(new Worker("cors-preflight-referrer.js"));
     </script>
   </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer.html (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer.html	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer.html	2016-07-19 16:08:56 UTC (rev 203408)
@@ -13,6 +13,7 @@
   <body>
     <script src=""
     <script src=""
-    <script src=""
+    <script src=""
+    <script src=""
   </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer.js (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer.js	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer.js	2016-07-19 16:08:56 UTC (rev 203408)
@@ -15,7 +15,7 @@
   urlParameters += "&allow_headers=x-force-preflight";
 
   promise_test(function(test) {
-    fetch(RESOURCES_DIR + "clean-stash.py?token=" + uuid_token).then(function(resp) {
+    return fetch(RESOURCES_DIR + "clean-stash.py?token=" + uuid_token).then(function(resp) {
       assert_equals(resp.status, 200, "Clean stash response's status is 200");
       return fetch(url + urlParameters, requestInit).then(function(resp) {
         assert_equals(resp.status, 200, "Response's status is 200");
@@ -27,7 +27,7 @@
   }, desc);
 }
 
-var corsUrl = "http://www1.{{host}}:{{ports[http][0]}}" + dirname(location.pathname) + RESOURCES_DIR + "preflight.py";
+var corsUrl = "http://{{host}}:{{ports[http][1]}}" + dirname(location.pathname) + RESOURCES_DIR + "preflight.py";
 var origin = "http://{{host}}:{{ports[http][0]}}";
 
 corsPreflightReferrer("Referrer policy: no-referrer", corsUrl, "no-referrer", "");

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html	2016-07-19 16:08:56 UTC (rev 203408)
@@ -12,7 +12,7 @@
   </head>
   <body>
     <script>
-      fetch_tests_from_worker(new Worker("cors-preflight-status.js?pipe=sub"));
+      fetch_tests_from_worker(new Worker("cors-preflight-status.js"));
     </script>
   </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status.html (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status.html	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status.html	2016-07-19 16:08:56 UTC (rev 203408)
@@ -12,6 +12,7 @@
   <body>
     <script src=""
     <script src=""
-    <script src=""
+    <script src=""
+    <script src=""
   </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status.js (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status.js	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status.js	2016-07-19 16:08:56 UTC (rev 203408)
@@ -2,6 +2,7 @@
   importScripts("/resources/testharness.js");
   importScripts("../resources/utils.js");
   importScripts("/common/utils.js");
+  importScripts("../resources/get-host-info.sub.js");
 }
 
 /* Check preflight is ok if status is ok status (200  to 299)*/
@@ -31,7 +32,7 @@
   }, desc);
 }
 
-var corsUrl = "http://www1.{{host}}:{{ports[http][0]}}" + dirname(location.pathname) + RESOURCES_DIR + "preflight.py";
+var corsUrl = get_host_info().HTTP_REMOTE_ORIGIN + dirname(location.pathname) + RESOURCES_DIR + "preflight.py";
 for (status of [200, 201, 202, 203, 204, 205, 206,
                 300, 301, 302, 303, 304, 305, 306, 307, 308,
                 400, 401, 402, 403, 404, 405,

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials.html (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials.html	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials.html	2016-07-19 16:08:56 UTC (rev 203408)
@@ -10,6 +10,7 @@
   </head>
   <body>
     <script src=""
-    <script src=""
+    <script src=""
+    <script src=""
   </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials.js (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials.js	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials.js	2016-07-19 16:08:56 UTC (rev 203408)
@@ -1,6 +1,7 @@
 if (this.document === undefined) {
   importScripts("/resources/testharness.js");
   importScripts("../resources/utils.js");
+  importScripts("../resources/get-host-info.sub.js")
 }
 
 function corsRedirectCredentials(desc, redirectUrl, redirectLocation, redirectStatus, locationCredentials) {
@@ -19,13 +20,15 @@
 var redirPath = dirname(location.pathname) + RESOURCES_DIR + "redirect.py";
 var preflightPath = dirname(location.pathname) + RESOURCES_DIR + "preflight.py";
 
-var localRedirect = "http://{{host}}:{{ports[http][0]}}" + redirPath;
-var remoteRedirect = "http://{{host}}:{{ports[http][1]}}" + redirPath;
+var host_info = get_host_info();
 
-var localLocation = "http://{{host}}:{{ports[http][0]}}" + preflightPath;
-var remoteLocation = "http://{{host}}:{{ports[http][1]}}" + preflightPath;
-var remoteLocation2 = "http://www.{{host}}:{{ports[http][0]}}" + preflightPath;
+var localRedirect = host_info.HTTP_ORIGIN + redirPath;
+var remoteRedirect = host_info.HTTP_ORIGIN_WITH_DIFFERENT_PORT + redirPath;
 
+var localLocation = host_info.HTTP_ORIGIN + preflightPath;
+var remoteLocation = host_info.HTTP_ORIGIN_WITH_DIFFERENT_PORT + preflightPath;
+var remoteLocation2 = host_info.HTTP_REMOTE_ORIGIN + preflightPath;
+
 for (var code of [301, 302, 303, 307, 308]) {
   corsRedirectCredentials("Redirect " + code + " from same origin to remote with user and password", localRedirect, remoteLocation, code, "user:password");
   corsRedirectCredentials("Redirect " + code + " from same origin to remote with user", localRedirect, remoteLocation, code, "user:");

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-worker.html (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-worker.html	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-worker.html	2016-07-19 16:08:56 UTC (rev 203408)
@@ -11,7 +11,7 @@
   </head>
   <body>
     <script>
-      fetch_tests_from_worker(new Worker("cors-redirect.js?pipe=sub"));
+      fetch_tests_from_worker(new Worker("cors-redirect.js"));
     </script>
   </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect.html (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect.html	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect.html	2016-07-19 16:08:56 UTC (rev 203408)
@@ -12,6 +12,7 @@
   <body>
     <script src=""
     <script src=""
-    <script src=""
+    <script src=""
+    <script src=""
   </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect.js (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect.js	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect.js	2016-07-19 16:08:56 UTC (rev 203408)
@@ -2,6 +2,7 @@
   importScripts("/resources/testharness.js");
   importScripts("/common/utils.js");
   importScripts("../resources/utils.js");
+  importScripts("../resources/get-host-info.sub.js");
 }
 
 function corsRedirect(desc, redirectUrl, redirectLocation, redirectStatus, expectedOrigin) {
@@ -27,13 +28,15 @@
 var redirPath = dirname(location.pathname) + RESOURCES_DIR + "redirect.py";
 var preflightPath = dirname(location.pathname) + RESOURCES_DIR + "preflight.py";
 
-var localRedirect = "http://{{host}}:{{ports[http][0]}}" + redirPath;
-var remoteRedirect = "http://www1.{{host}}:{{ports[http][0]}}" + redirPath;
+var host_info = get_host_info();
 
-var localLocation = "http://{{host}}:{{ports[http][0]}}" + preflightPath;
-var remoteLocation = "http://www1.{{host}}:{{ports[http][0]}}" + preflightPath;
-var remoteLocation2 = "http://www.{{host}}:{{ports[http][0]}}" + preflightPath;
+var localRedirect = host_info.HTTP_ORIGIN + redirPath;
+var remoteRedirect = host_info.HTTP_REMOTE_ORIGIN + redirPath;
 
+var localLocation = host_info.HTTP_ORIGIN + preflightPath;
+var remoteLocation = host_info.HTTP_REMOTE_ORIGIN + preflightPath;
+var remoteLocation2 = host_info.HTTP_ORIGIN_WITH_DIFFERENT_PORT + preflightPath;
+
 for (var code of [301, 302, 303, 307, 308]) {
   corsRedirect("Redirect " + code + ": cors to same cors", remoteRedirect, remoteLocation, code, location.origin);
   corsRedirect("Redirect " + code + ": cors to another cors", remoteRedirect, remoteLocation2, code, "null");

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-cache.html (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-cache.html	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-cache.html	2016-07-19 16:08:56 UTC (rev 203408)
@@ -8,7 +8,7 @@
     <script src=""
     <script src=""
     <script src=""
-    <script src=""
+    <script src=""
   </head>
   <body>
     <script>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/resources/w3c-import.log (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/resources/w3c-import.log	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/resources/w3c-import.log	2016-07-19 16:08:56 UTC (rev 203408)
@@ -16,4 +16,3 @@
 ------------------------------------------------------------------------
 List of files:
 /LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/resources/cache.py
-/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/resources/get-host-info.sub.js

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/get-host-info.sub.js (0 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/get-host-info.sub.js	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/get-host-info.sub.js	2016-07-19 16:08:56 UTC (rev 203408)
@@ -0,0 +1,36 @@
+// This file is duplicated verbatim from:
+// service-workers/service-worker/resources/get-host-info.sub.js
+// with the rationale that:
+// - it's better to not reinvent this
+// - at the same time, referencing tests deep inside a sibling test group is
+//   not a great idea and copying the file is the lesser evil.
+function get_host_info() {
+  var ORIGINAL_HOST = '127.0.0.1';
+  var REMOTE_HOST = 'localhost';
+  var UNAUTHENTICATED_HOST = 'example.test';
+  var HTTP_PORT = 8000;
+  var HTTP_PORT2 = 8080;
+  var HTTPS_PORT = 8443;
+  try {
+    // In W3C test, we can get the hostname and port number in config.json
+    // using wptserve's built-in pipe.
+    // http://wptserve.readthedocs.org/en/latest/pipes.html#built-in-pipes
+    HTTP_PORT = eval('{{ports[http][0]}}');
+    HTTP_PORT2 = eval('{{ports[http][1]}}');
+    HTTPS_PORT = eval('{{ports[https][0]}}');
+    ORIGINAL_HOST = eval('\'{{host}}\'');
+    REMOTE_HOST = (ORIGINAL_HOST === 'localhost') ? '127.0.0.1' : ('www1.' + ORIGINAL_HOST);
+  } catch (e) {
+  }
+  return {
+    HTTP_ORIGIN: 'http://' + ORIGINAL_HOST + ':' + HTTP_PORT,
+    HTTPS_ORIGIN: 'https://' + ORIGINAL_HOST + ':' + HTTPS_PORT,
+    HTTPS_ORIGIN_WITH_CREDS: 'https://foo:bar@' + ORIGINAL_HOST + ':' + HTTPS_PORT,
+    HTTP_ORIGIN_WITH_DIFFERENT_PORT: 'http://' + ORIGINAL_HOST + ':' + HTTP_PORT2,
+    HTTP_REMOTE_ORIGIN: 'http://' + REMOTE_HOST + ':' + HTTP_PORT,
+    HTTP_REMOTE_ORIGIN_WITH_DIFFERENT_PORT: 'http://' + REMOTE_HOST + ':' + HTTP_PORT2,
+    HTTPS_REMOTE_ORIGIN: 'https://' + REMOTE_HOST + ':' + HTTPS_PORT,
+    HTTPS_REMOTE_ORIGIN_WITH_CREDS: 'https://foo:bar@' + REMOTE_HOST + ':' + HTTPS_PORT,
+    UNAUTHENTICATED_ORIGIN: 'http://' + UNAUTHENTICATED_HOST + ':' + HTTP_PORT
+  };
+}

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/utils.js (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/utils.js	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/utils.js	2016-07-19 16:08:56 UTC (rev 203408)
@@ -53,7 +53,7 @@
 
 function validateBufferFromString(buffer, expectedValue, message)
 {
-  return assert_array_equals(new Uint8Array(buffer), stringToArray(expectedValue), message);
+  return assert_array_equals(new Uint8Array(buffer !== undefined ? buffer : []), stringToArray(expectedValue), message);
 }
 
 function validateStreamFromString(reader, expectedValue, retrievedArrayBuffer) {

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/w3c-import.log (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/w3c-import.log	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/w3c-import.log	2016-07-19 16:08:56 UTC (rev 203408)
@@ -18,6 +18,7 @@
 /LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/authentication.py
 /LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/clean-stash.py
 /LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/data.json
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/get-host-info.sub.js
 /LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/inspect-headers.py
 /LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/method.py
 /LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/preflight.py

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-clone-expected.txt (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-clone-expected.txt	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-clone-expected.txt	2016-07-19 16:08:56 UTC (rev 203408)
@@ -3,5 +3,5 @@
 PASS Check Response's clone has the expected attribute values 
 PASS Check orginal response's body after cloning 
 PASS Check cloned response's body 
-FAIL Cannot clone a disturbed response assert_true: response is disturbed expected true got false
+PASS Cannot clone a disturbed response 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-clone.html (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-clone.html	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-clone.html	2016-07-19 16:08:56 UTC (rev 203408)
@@ -54,7 +54,7 @@
       }, "Check cloned response's body");
 
       promise_test(function(test) {
-        var disturbedResponse = new Response();
+        var disturbedResponse = new Response("data");
         return disturbedResponse.text().then(function() {
             assert_true(disturbedResponse.bodyUsed, "response is disturbed");
             assert_throws(new TypeError() , function() { disturbedResponse.clone(); },

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-consume-stream-expected.txt (203407 => 203408)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-consume-stream-expected.txt	2016-07-19 14:33:16 UTC (rev 203407)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-consume-stream-expected.txt	2016-07-19 16:08:56 UTC (rev 203408)
@@ -1,6 +1,6 @@
 
 PASS Read empty text response's body as readableStream 
-FAIL Read empty blob response's body as readableStream promise_test: Unhandled rejection with value: object "TypeError: Invalid array length argument"
+PASS Read empty blob response's body as readableStream 
 PASS Read blob response's body as readableStream 
 PASS Read text response's body as readableStream 
 FAIL Read form data response's body as readableStream promise_test: Unhandled rejection with value: "not implemented"
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to