diff --git a/cors/README.md b/cors/README.md index b239462625f667..aa5ff90d486e8b 100644 --- a/cors/README.md +++ b/cors/README.md @@ -5,4 +5,4 @@ These tests are located here as originally the CORS protocol was defined on its More CORS tests can be found in * /fetch -* /XMLHttpRequest +* /xhr diff --git a/fetch/README.md b/fetch/README.md index 3c5905690c1942..dcaad0219d5a53 100644 --- a/fetch/README.md +++ b/fetch/README.md @@ -3,4 +3,4 @@ Tests for the [Fetch Standard](https://fetch.spec.whatwg.org/). More Fetch tests can be found in * /cors -* /XMLHttpRequest +* /xhr diff --git a/fetch/api/basic/request-headers-case.any.js b/fetch/api/basic/request-headers-case.any.js index 549744fb05be83..067eabb13329b1 100644 --- a/fetch/api/basic/request-headers-case.any.js +++ b/fetch/api/basic/request-headers-case.any.js @@ -1,11 +1,11 @@ promise_test(() => { - return fetch("/XMLHttpRequest/resources/echo-headers.py", {headers: [["THIS-is-A-test", 1], ["THIS-IS-A-TEST", 2]] }).then(res => res.text()).then(body => { + return fetch("/xhr/resources/echo-headers.py", {headers: [["THIS-is-A-test", 1], ["THIS-IS-A-TEST", 2]] }).then(res => res.text()).then(body => { assert_regexp_match(body, /THIS-is-A-test: 1, 2/) }) }, "Multiple headers with the same name, different case (THIS-is-A-test first)") promise_test(() => { - return fetch("/XMLHttpRequest/resources/echo-headers.py", {headers: [["THIS-IS-A-TEST", 1], ["THIS-is-A-test", 2]] }).then(res => res.text()).then(body => { + return fetch("/xhr/resources/echo-headers.py", {headers: [["THIS-IS-A-TEST", 1], ["THIS-is-A-test", 2]] }).then(res => res.text()).then(body => { assert_regexp_match(body, /THIS-IS-A-TEST: 1, 2/) }) }, "Multiple headers with the same name, different case (THIS-IS-A-TEST first)") diff --git a/fetch/api/response/response-trailer.html b/fetch/api/response/response-trailer.html index 5454040a35632e..cbea155d4dd845 100644 --- a/fetch/api/response/response-trailer.html +++ b/fetch/api/response/response-trailer.html @@ -3,10 +3,10 @@
- + diff --git a/XMLHttpRequest/access-control-and-redirects-async.htm b/xhr/access-control-and-redirects-async.htm similarity index 85% rename from XMLHttpRequest/access-control-and-redirects-async.htm rename to xhr/access-control-and-redirects-async.htm index bf16c3c8a1cf1c..a77846f4f5f05c 100644 --- a/XMLHttpRequest/access-control-and-redirects-async.htm +++ b/xhr/access-control-and-redirects-async.htm @@ -11,7 +11,7 @@ function runTest(test, destination, parameters, customHeader, local, expectSuccess) { const xhr = new XMLHttpRequest(); const url = (local ? get_host_info().HTTP_ORIGIN : get_host_info().HTTP_REMOTE_ORIGIN) + - "/XMLHttpRequest/resources/redirect-cors.py?location=" + destination + "&" + parameters; + "/xhr/resources/redirect-cors.py?location=" + destination + "&" + parameters; xhr.open("GET", url, true); @@ -41,21 +41,21 @@ // The redirect response fails the access check because the redirect lacks a CORS header. async_test(t => { runTest(t, get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-allow-star.py", "", + "/xhr/resources/access-control-basic-allow-star.py", "", withoutCustomHeader, remote, fails) }, "Request is redirected without CORS headers to a response with Access-Control-Allow-Origin=*"); // The redirect response passes the access check. async_test(t => { runTest(t, get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-allow-star.py", "allow_origin=true", + "/xhr/resources/access-control-basic-allow-star.py", "allow_origin=true", withoutCustomHeader, remote, succeeds) }, "Request is redirected to a response with Access-Control-Allow-Origin=*"); // The redirect response fails the access check because user info was sent. async_test(t => { runTest(t, get_host_info().HTTP_REMOTE_ORIGIN.replace("http://", "http://username:password@") + - "/XMLHttpRequest/resources/access-control-basic-allow-star.py", "allow_origin=true", + "/xhr/resources/access-control-basic-allow-star.py", "allow_origin=true", withoutCustomHeader, remote, fails) }, "Request with user info is redirected to a response with Access-Control-Allow-Origin=*"); @@ -67,21 +67,21 @@ // The preflighted redirect response fails the access check because of preflighting. async_test(t => { runTest(t, get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-allow-star.py", + "/xhr/resources/access-control-basic-allow-star.py", "allow_origin=true&redirect_preflight=true", withCustomHeader, remote, fails) }, "Preflighted request is redirected to a response with Access-Control-Allow-Origin=*"); // The preflighted redirect response fails the access check after successful preflighting. async_test(t => { runTest(t, get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-allow-star.py", + "/xhr/resources/access-control-basic-allow-star.py", "allow_origin=true&allow_header=x-test&redirect_preflight=true", withCustomHeader, remote, fails) }, "Preflighted request is redirected to a response with Access-Control-Allow-Origin=* and header allowed"); // The same-origin redirect response passes the access check. async_test(t => { - runTest(t, get_host_info().HTTP_ORIGIN + "/XMLHttpRequest/resources/pass.txt", + runTest(t, get_host_info().HTTP_ORIGIN + "/xhr/resources/pass.txt", "", withCustomHeader, local, succeeds) }, "Request is redirected to a same-origin resource file"); diff --git a/XMLHttpRequest/access-control-and-redirects.htm b/xhr/access-control-and-redirects.htm similarity index 66% rename from XMLHttpRequest/access-control-and-redirects.htm rename to xhr/access-control-and-redirects.htm index dcdf40044cbd5f..a10bc1f5446355 100644 --- a/XMLHttpRequest/access-control-and-redirects.htm +++ b/xhr/access-control-and-redirects.htm @@ -29,31 +29,31 @@ } test(t => { runSync(t, "resources/redirect-cors.py?location=" + get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-allow.py") + "/xhr/resources/access-control-basic-allow.py") }, "Local sync redirect to remote origin"); async_test(t => { runAsync(t, "resources/redirect-cors.py?location=" + get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-allow.py") + "/xhr/resources/access-control-basic-allow.py") }, "Local async redirect to remote origin"); test(t => { runSync(t, get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/redirect-cors.py?location=" + get_host_info().HTTP_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-allow.py&allow_origin=true") + "/xhr/resources/redirect-cors.py?location=" + get_host_info().HTTP_ORIGIN + + "/xhr/resources/access-control-basic-allow.py&allow_origin=true") }, "Remote sync redirect to local origin"); async_test(t => { runAsync(t, get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/redirect-cors.py?location=" + get_host_info().HTTP_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-allow.py&allow_origin=true") + "/xhr/resources/redirect-cors.py?location=" + get_host_info().HTTP_ORIGIN + + "/xhr/resources/access-control-basic-allow.py&allow_origin=true") }, "Remote async redirect to local origin"); test(t => { runSync(t, get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/redirect-cors.py?location=" + get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-allow.py&allow_origin=true") + "/xhr/resources/redirect-cors.py?location=" + get_host_info().HTTP_REMOTE_ORIGIN + + "/xhr/resources/access-control-basic-allow.py&allow_origin=true") }, "Remote sync redirect to same remote origin"); async_test(t => { runAsync(t, get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/redirect-cors.py?location=" + get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-allow.py&allow_origin=true") + "/xhr/resources/redirect-cors.py?location=" + get_host_info().HTTP_REMOTE_ORIGIN + + "/xhr/resources/access-control-basic-allow.py&allow_origin=true") }, "Remote async redirect to same remote origin"); diff --git a/XMLHttpRequest/access-control-basic-allow-non-cors-safelisted-method-async.htm b/xhr/access-control-basic-allow-non-cors-safelisted-method-async.htm similarity index 92% rename from XMLHttpRequest/access-control-basic-allow-non-cors-safelisted-method-async.htm rename to xhr/access-control-basic-allow-non-cors-safelisted-method-async.htm index 57721aa684b9a8..e468c82ccab15e 100644 --- a/XMLHttpRequest/access-control-basic-allow-non-cors-safelisted-method-async.htm +++ b/xhr/access-control-basic-allow-non-cors-safelisted-method-async.htm @@ -18,7 +18,7 @@ xhr.onerror = test.unreached_func("Unexpected error."); xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-put-allow.py"); + "/xhr/resources/access-control-basic-put-allow.py"); xhr.setRequestHeader("Content-Type", "text/plain; charset=UTF-8"); xhr.send("PASS: PUT data received"); }, "Allow async PUT request"); diff --git a/XMLHttpRequest/access-control-basic-allow-non-cors-safelisted-method.htm b/xhr/access-control-basic-allow-non-cors-safelisted-method.htm similarity index 83% rename from XMLHttpRequest/access-control-basic-allow-non-cors-safelisted-method.htm rename to xhr/access-control-basic-allow-non-cors-safelisted-method.htm index 08f41117f87935..2612265173eee1 100644 --- a/XMLHttpRequest/access-control-basic-allow-non-cors-safelisted-method.htm +++ b/xhr/access-control-basic-allow-non-cors-safelisted-method.htm @@ -11,7 +11,7 @@ test(function() { const xhr = new XMLHttpRequest; - xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-put-allow.py", false); + xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-put-allow.py", false); xhr.setRequestHeader("Content-Type", "text/plain; charset=UTF-8"); diff --git a/XMLHttpRequest/access-control-basic-allow-preflight-cache-invalidation-by-header.htm b/xhr/access-control-basic-allow-preflight-cache-invalidation-by-header.htm similarity index 75% rename from XMLHttpRequest/access-control-basic-allow-preflight-cache-invalidation-by-header.htm rename to xhr/access-control-basic-allow-preflight-cache-invalidation-by-header.htm index 5a1e396e52f18d..306eb02b3eb55e 100644 --- a/XMLHttpRequest/access-control-basic-allow-preflight-cache-invalidation-by-header.htm +++ b/xhr/access-control-basic-allow-preflight-cache-invalidation-by-header.htm @@ -20,7 +20,7 @@ firstRequest(); }); - xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/reset-token.py?token=" + uuid, true); + xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/reset-token.py?token=" + uuid, true); xhr.send(); function firstRequest() { @@ -28,7 +28,7 @@ assert_equals(xhr.responseText, "PASS: First PUT request."); secondRequest(); }); - xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-preflight-cache-invalidation.py?token=" + uuid, true); + xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-preflight-cache-invalidation.py?token=" + uuid, true); xhr.send(); } @@ -38,7 +38,7 @@ test.done(); }); // Send a header not included in the inital cache. - xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-preflight-cache-invalidation.py?token=" + uuid, true); + xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-preflight-cache-invalidation.py?token=" + uuid, true); xhr.setRequestHeader("x-test", "headerValue"); xhr.send(); } diff --git a/XMLHttpRequest/access-control-basic-allow-preflight-cache-invalidation-by-method.htm b/xhr/access-control-basic-allow-preflight-cache-invalidation-by-method.htm similarity index 78% rename from XMLHttpRequest/access-control-basic-allow-preflight-cache-invalidation-by-method.htm rename to xhr/access-control-basic-allow-preflight-cache-invalidation-by-method.htm index 058943e839d22d..f8a99a25560c41 100644 --- a/XMLHttpRequest/access-control-basic-allow-preflight-cache-invalidation-by-method.htm +++ b/xhr/access-control-basic-allow-preflight-cache-invalidation-by-method.htm @@ -20,7 +20,7 @@ firstRequest(); }); - xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/reset-token.py?token=" + uuid, true); + xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/reset-token.py?token=" + uuid, true); xhr.send(); function firstRequest() { @@ -28,7 +28,7 @@ assert_equals(xhr.responseText, "PASS: First PUT request."); secondRequest(); }); - xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-preflight-cache-invalidation.py?token=" + uuid, true); + xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-preflight-cache-invalidation.py?token=" + uuid, true); xhr.send(); } @@ -38,7 +38,7 @@ test.done(); }); // Send a header not included in the inital cache. - xhr.open("XMETHOD", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-preflight-cache-invalidation.py?token=" + uuid, true); + xhr.open("XMETHOD", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-preflight-cache-invalidation.py?token=" + uuid, true); xhr.send(); } }, "Preflight cache should be invalidated by changed method"); diff --git a/XMLHttpRequest/access-control-basic-allow-preflight-cache-timeout.htm b/xhr/access-control-basic-allow-preflight-cache-timeout.htm similarity index 74% rename from XMLHttpRequest/access-control-basic-allow-preflight-cache-timeout.htm rename to xhr/access-control-basic-allow-preflight-cache-timeout.htm index 56702c01d0e886..ccd961f210834a 100644 --- a/XMLHttpRequest/access-control-basic-allow-preflight-cache-timeout.htm +++ b/xhr/access-control-basic-allow-preflight-cache-timeout.htm @@ -20,7 +20,7 @@ firstRequest(); }); - xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/reset-token.py?token=" + uuid, true); + xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/reset-token.py?token=" + uuid, true); xhr.send(); function firstRequest() { @@ -28,7 +28,7 @@ assert_equals(xhr.responseText, "PASS: First PUT request."); step_timeout(secondRequest, 3000); // 3 seconds }); - xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-preflight-cache-timeout.py?token=" + uuid, true); + xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-preflight-cache-timeout.py?token=" + uuid, true); xhr.send(); } @@ -37,7 +37,7 @@ assert_equals(xhr.responseText, "PASS: Second OPTIONS request was sent."); test.done(); }); - xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-preflight-cache-timeout.py?token=" + uuid, true); + xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-preflight-cache-timeout.py?token=" + uuid, true); xhr.send(); } }, "Preflight cache should be invalidated on timeout"); diff --git a/XMLHttpRequest/access-control-basic-allow-preflight-cache.htm b/xhr/access-control-basic-allow-preflight-cache.htm similarity index 75% rename from XMLHttpRequest/access-control-basic-allow-preflight-cache.htm rename to xhr/access-control-basic-allow-preflight-cache.htm index ad38a6bdb1d9a7..b8deda4349e080 100644 --- a/XMLHttpRequest/access-control-basic-allow-preflight-cache.htm +++ b/xhr/access-control-basic-allow-preflight-cache.htm @@ -20,7 +20,7 @@ firstRequest(); }); - xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/reset-token.py?token=" + uuid, true); + xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/reset-token.py?token=" + uuid, true); xhr.send(); function firstRequest() { @@ -28,7 +28,7 @@ assert_equals(xhr.responseText, "PASS: First PUT request."); secondRequest(); }); - xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-preflight-cache.py?token=" + uuid, true); + xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-preflight-cache.py?token=" + uuid, true); xhr.send(); } @@ -36,7 +36,7 @@ xhr.onload = test.step_func_done(function() { assert_equals(xhr.responseText, "PASS: Second PUT request. Preflight worked."); }); - xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-preflight-cache.py?token=" + uuid, true); + xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-preflight-cache.py?token=" + uuid, true); xhr.send(); } }, "Preflight cache should allow second request"); diff --git a/XMLHttpRequest/access-control-basic-allow-star.htm b/xhr/access-control-basic-allow-star.htm similarity index 80% rename from XMLHttpRequest/access-control-basic-allow-star.htm rename to xhr/access-control-basic-allow-star.htm index fac25e297b5152..d05222f2002f22 100644 --- a/XMLHttpRequest/access-control-basic-allow-star.htm +++ b/xhr/access-control-basic-allow-star.htm @@ -11,7 +11,7 @@ const xhr = new XMLHttpRequest; test(function(test) { - xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-allow-star.py", false); + xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-allow-star.py", false); xhr.send(); diff --git a/XMLHttpRequest/access-control-basic-allow.htm b/xhr/access-control-basic-allow.htm similarity index 81% rename from XMLHttpRequest/access-control-basic-allow.htm rename to xhr/access-control-basic-allow.htm index f7e67babdf1ad5..61c02ed5428cc5 100644 --- a/XMLHttpRequest/access-control-basic-allow.htm +++ b/xhr/access-control-basic-allow.htm @@ -11,7 +11,7 @@ test(function() { const xhr = new XMLHttpRequest; - xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-allow.py", false); + xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-allow.py", false); xhr.send(); diff --git a/XMLHttpRequest/access-control-basic-cors-safelisted-request-headers.htm b/xhr/access-control-basic-cors-safelisted-request-headers.htm similarity index 86% rename from XMLHttpRequest/access-control-basic-cors-safelisted-request-headers.htm rename to xhr/access-control-basic-cors-safelisted-request-headers.htm index 1d570a3c93ee36..20b875b9bddc3c 100644 --- a/XMLHttpRequest/access-control-basic-cors-safelisted-request-headers.htm +++ b/xhr/access-control-basic-cors-safelisted-request-headers.htm @@ -11,7 +11,7 @@ test(function() { const xhr = new XMLHttpRequest; - xhr.open("POST", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-cors-safelisted-request-headers.py", false); + xhr.open("POST", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-cors-safelisted-request-headers.py", false); xhr.setRequestHeader("Accept", "*"); xhr.setRequestHeader("Accept-Language", "ru"); diff --git a/XMLHttpRequest/access-control-basic-cors-safelisted-response-headers.htm b/xhr/access-control-basic-cors-safelisted-response-headers.htm similarity index 92% rename from XMLHttpRequest/access-control-basic-cors-safelisted-response-headers.htm rename to xhr/access-control-basic-cors-safelisted-response-headers.htm index c795083ece9912..a5c470b74f51d6 100644 --- a/XMLHttpRequest/access-control-basic-cors-safelisted-response-headers.htm +++ b/xhr/access-control-basic-cors-safelisted-response-headers.htm @@ -12,7 +12,7 @@ const xhr = new XMLHttpRequest; xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-whitelist-response-headers.py", false); + "/xhr/resources/access-control-basic-whitelist-response-headers.py", false); xhr.send(); assert_not_equals(xhr.getResponseHeader("cache-control"), null); diff --git a/XMLHttpRequest/access-control-basic-denied.htm b/xhr/access-control-basic-denied.htm similarity index 92% rename from XMLHttpRequest/access-control-basic-denied.htm rename to xhr/access-control-basic-denied.htm index 924bdd55a6990d..3bcd2517245f5d 100644 --- a/XMLHttpRequest/access-control-basic-denied.htm +++ b/xhr/access-control-basic-denied.htm @@ -8,7 +8,7 @@ diff --git a/XMLHttpRequest/access-control-preflight-async-header-denied.htm b/xhr/access-control-preflight-async-header-denied.htm similarity index 93% rename from XMLHttpRequest/access-control-preflight-async-header-denied.htm rename to xhr/access-control-preflight-async-header-denied.htm index 84a60eb6f635fc..a00cc588981c37 100644 --- a/XMLHttpRequest/access-control-preflight-async-header-denied.htm +++ b/xhr/access-control-preflight-async-header-denied.htm @@ -11,7 +11,7 @@ -