Bug 1452883 [wpt PR 10394] - Stringify RequestInit.body, a=testonly
authorYutaka Hirano <yhirano@chromium.org>
Sun, 22 Apr 2018 14:55:10 +0000
changeset 468864 cf6b746fb4c27da0bcd73b3e4e966c04bcb6da7e
parent 468863 5c86d62788bf7e4f8e6f41cbddf8d207cda0ad46
child 468865 64574b6ba265941a1ca3e1d1fbcbb058751780bf
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1452883, 10394, 831076, 1004561, 550523
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 1452883 [wpt PR 10394] - Stringify RequestInit.body, a=testonly Automatic update from web-platform-testsStringify RequestInit.body As specified, RequestInit.body should be stringified, i.e., {toString(): () => 'hi!'} should be treated as same as 'hi!'. Bug: 831076 Change-Id: I4118c0faa9535d62b3db2529bf23716fdc25a997 Reviewed-on: https://chromium-review.googlesource.com/1004561 Reviewed-by: Adam Rice <ricea@chromium.org> Reviewed-by: Matt Falkenhagen <falken@chromium.org> Commit-Queue: Yutaka Hirano <yhirano@chromium.org> Cr-Commit-Position: refs/heads/master@{#550523} -- wpt-commits: 96bceca65945e50c61128eaf5473fc9bc9e46c99 wpt-pr: 10394
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/fetch/api/request/request-init-002.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -555478,17 +555478,17 @@
    "679ff0c44a0ece1c480f5296e738b7a15f4c79cb",
    "testharness"
   ],
   "fetch/api/request/request-init-001.sub.html": [
    "49bc4349b4e7a85d88cacd54227355aa986535f1",
    "testharness"
   ],
   "fetch/api/request/request-init-002.html": [
-   "e6647394acca551e354b27c16013ef713c8ba64e",
+   "3a0e29dacdea8256a57293f8256c881d307cd4f6",
    "testharness"
   ],
   "fetch/api/request/request-init-003.sub.html": [
    "98e47b378d13b9b94601eb7c6035c457d53151ca",
    "testharness"
   ],
   "fetch/api/request/request-keepalive-quota.html": [
    "0b9786a3878a361ba8ec3291216d475bd5148541",
--- a/testing/web-platform/tests/fetch/api/request/request-init-002.html
+++ b/testing/web-platform/tests/fetch/api/request/request-init-002.html
@@ -38,29 +38,30 @@
           }
           var reqHeaders = request.headers;
           var mime = reqHeaders.get("Content-Type");
           assert_true(!body || (mime && mime.search(bodyType) > -1), "Content-Type header should be \"" + bodyType + "\", not \"" + mime + "\"");
           return request.text().then(function(bodyAsText) {
             //not equals: cannot guess formData exact value
             assert_true( bodyAsText.search(expectedTextBody) > -1, "Retrieve and verify request body");
           });
-        }, "Initialize Request's body with " + bodyType);
+        }, `Initialize Request's body with "${body}", ${bodyType}`);
       }
 
       var blob = new Blob(["This is a blob"], {type: "application/octet-binary"});
       var formaData = new FormData();
       formaData.append("name", "value");
       var usvString = "This is a USVString"
 
       checkRequestInit(undefined, undefined, "");
       checkRequestInit(null, null, "");
       checkRequestInit(blob, "application/octet-binary", "This is a blob");
       checkRequestInit(formaData, "multipart/form-data", "name=\"name\"\r\n\r\nvalue");
       checkRequestInit(usvString, "text/plain;charset=UTF-8", "This is a USVString");
+      checkRequestInit({toString: () => "hi!"}, "text/plain;charset=UTF-8", "hi!");
 
       // Ensure test does not time out in case of missing URLSearchParams support.
       if (window.URLSearchParams) {
         var urlSearchParams = new URLSearchParams("name=value");
         checkRequestInit(urlSearchParams, "application/x-www-form-urlencoded;charset=UTF-8", "name=value");
       } else {
         promise_test(function(test) {
           return Promise.reject("URLSearchParams not supported");