Bug 1453623 [wpt PR 10442] - Fetch: expand Response.redirect() assertions, a=testonly
authorAnne van Kesteren <annevk@annevk.nl>
Tue, 01 May 2018 14:22:02 +0000
changeset 472633 d9ac927c0b85220a5183f9e22f3c35affd531a8d
parent 472632 40f11e68bc10d8f47e4774b4399af2870cdfddb0
child 472634 b08c5435b670792c5c311227daf9d2af7382c18d
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1453623, 10442
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1453623 [wpt PR 10442] - Fetch: expand Response.redirect() assertions, a=testonly Automatic update from web-platform-testsFetch: expand Response.redirect() assertions Needed for https://github.com/whatwg/fetch/issues/664 and https://github.com/whatwg/fetch/pull/600. -- wpt-commits: 507af0c03617714bfd4134c54da4d534906ee52b wpt-pr: 10442
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/fetch/api/response/response-static-redirect.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -557009,17 +557009,17 @@
    "5b87fa0d008f633d73bd87ab1755eee719b104cc",
    "testharness"
   ],
   "fetch/api/response/response-static-error.html": [
    "96b1d4f58925cb9ba5a07aef28aa4b869c67f93b",
    "testharness"
   ],
   "fetch/api/response/response-static-redirect.html": [
-   "e497388ce041fd300200d23c63caadb1fe53d1c1",
+   "235d32c0be7164d9f25cfa40988ad10096286508",
    "testharness"
   ],
   "fetch/api/response/response-stream-disturbed-1.html": [
    "366ba245dde5eb22e15b30bdf306cfe33ef392de",
    "testharness"
   ],
   "fetch/api/response/response-stream-disturbed-2.html": [
    "3523df1bc73b2eb101c6308544b831affdd0e8c4",
--- a/testing/web-platform/tests/fetch/api/response/response-static-redirect.html
+++ b/testing/web-platform/tests/fetch/api/response/response-static-redirect.html
@@ -9,26 +9,34 @@
     <script src="/resources/testharness.js"></script>
     <script src="/resources/testharnessreport.js"></script>
   </head>
   <body>
     <script>
       var url = "http://test.url:1234/";
       test(function() {
         redirectResponse = Response.redirect(url);
+        assert_equals(redirectResponse.type, "default");
+        assert_false(redirectResponse.redirected);
+        assert_false(redirectResponse.ok);
         assert_equals(redirectResponse.status, 302, "Default redirect status is 302");
         assert_equals(redirectResponse.headers.get("Location"), url,
           "redirected response has Location header with the correct url");
+        assert_equals(redirectResponse.statusText, "");
       }, "Check default redirect response");
 
-      var redirectStatus = [301, 302, 303, 307, 308];
-      redirectStatus.forEach(function(status) {
+      [301, 302, 303, 307, 308].forEach(function(status) {
         test(function() {
           redirectResponse = Response.redirect(url, status);
+          assert_equals(redirectResponse.type, "default");
+          assert_false(redirectResponse.redirected);
+          assert_false(redirectResponse.ok);
           assert_equals(redirectResponse.status, status, "Redirect status is " + status);
+          assert_equals(redirectResponse.headers.get("Location"), url);
+          assert_equals(redirectResponse.statusText, "");
         }, "Check response returned by static method redirect(), status = " + status);
       });
 
       test(function() {
         var invalidUrl = "http://:This is not an url";
         assert_throws(new TypeError(), function() { Response.redirect(invalidUrl); },
           "Expect TypeError exception");
       }, "Check error returned when giving invalid url to redirect()");