Bug 1508996 - Change Response's statusText's default, r=valentin
authorAndrea Marchesini <amarchesini@mozilla.com>
Tue, 26 Feb 2019 03:56:08 +0000
changeset 518909 04b5ccccaa742b42be9a4200b17cfffc29a5d0f9
parent 518908 62d66c338b8a4c4f59121bbf91e0b455c33eb404
child 518910 95fa937ab43270890c88437fb7bd80ef8ce4480c
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin
bugs1508996
milestone67.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 1508996 - Change Response's statusText's default, r=valentin Differential Revision: https://phabricator.services.mozilla.com/D21026
devtools/client/netmonitor/test/service-workers/status-codes-service-worker.js
dom/tests/mochitest/fetch/test_response.js
dom/webidl/Response.webidl
testing/web-platform/meta/fetch/api/response/response-clone.html.ini
testing/web-platform/meta/fetch/api/response/response-init-001.html.ini
--- a/devtools/client/netmonitor/test/service-workers/status-codes-service-worker.js
+++ b/devtools/client/netmonitor/test/service-workers/status-codes-service-worker.js
@@ -4,11 +4,11 @@
 "use strict";
 
 self.addEventListener("activate", event => {
   // start controlling the already loaded page
   event.waitUntil(self.clients.claim());
 });
 
 self.addEventListener("fetch", event => {
-  const response = new Response("Service worker response");
+  const response = new Response("Service worker response", { statusText: "OK" });
   event.respondWith(response);
 });
--- a/dom/tests/mochitest/fetch/test_response.js
+++ b/dom/tests/mochitest/fetch/test_response.js
@@ -1,15 +1,15 @@
 function testDefaultCtor() {
   var res = new Response();
   is(res.type, "default", "Default Response type is default");
   ok(res.headers instanceof Headers, "Response should have non-null Headers object");
   is(res.url, "", "URL should be empty string");
   is(res.status, 200, "Default status is 200");
-  is(res.statusText, "OK", "Default statusText is OK");
+  is(res.statusText, "", "Default statusText is an empty string");
 }
 
 function testClone() {
   var orig = new Response("This is a body", {
               status: 404,
               statusText: "Not Found",
               headers: { "Content-Length": 5 },
             });
--- a/dom/webidl/Response.webidl
+++ b/dom/webidl/Response.webidl
@@ -39,13 +39,13 @@ Response implements Body;
 // See bug 1387483.
 partial interface Response {
   [GetterThrows, Func="mozilla::dom::DOMPrefs::javascript_options_streams"]
   readonly attribute ReadableStream? body;
 };
 
 dictionary ResponseInit {
   unsigned short status = 200;
-  ByteString statusText = "OK";
+  ByteString statusText = "";
   HeadersInit headers;
 };
 
 enum ResponseType { "basic", "cors", "default", "error", "opaque", "opaqueredirect" };
--- a/testing/web-platform/meta/fetch/api/response/response-clone.html.ini
+++ b/testing/web-platform/meta/fetch/api/response/response-clone.html.ini
@@ -30,11 +30,8 @@
     expected: FAIL
 
   [Check response clone use structureClone for teed ReadableStreams (DataViewchunk)]
     expected: FAIL
 
   [Cloned responses should provide the same data]
     expected: FAIL
 
-  [Check Response's clone with default values, without body]
-    expected: FAIL
-
deleted file mode 100644
--- a/testing/web-platform/meta/fetch/api/response/response-init-001.html.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[response-init-001.html]
-  [Check default value for statusText attribute]
-    expected: FAIL
-