Bug 1444345 [wpt PR 9460] - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=182637, a=testonly
authoryouennf <youennf@users.noreply.github.com>
Mon, 26 Mar 2018 11:20:09 +0000
changeset 467001 a28c69d8cd5fe11111530bb2657c5d90b82c29f6
parent 467000 b4350afa07ca23d6e0d69396c067407d4c560469
child 467002 86880ae8be29f9c884b6cb620c98c268862a28dc
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
bugs1444345, 182637
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 1444345 [wpt PR 9460] - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=182637, a=testonly Automatic update from web-platform-testsMerge pull request #9460 from youennf/wpt-export-for-webkit-182637 WebKit export of https://bugs.webkit.org/show_bug.cgi?id=182637 wpt-commits: fade9e6a04e2a3b7799735cb80f76299c3800001 wpt-pr: 9460 wpt-commits: fade9e6a04e2a3b7799735cb80f76299c3800001 wpt-pr: 9460
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/service-workers/cache-storage/script-tests/cache-put.js
testing/web-platform/tests/service-workers/cache-storage/window/cache-put.https.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -584014,17 +584014,17 @@
    "2e56e6185845e752fb828e20e2f1e10143c95073",
    "support"
   ],
   "service-workers/cache-storage/script-tests/cache-matchAll.js": [
    "381765d1ce951a62d42d7a565f6e856e91ba3f55",
    "support"
   ],
   "service-workers/cache-storage/script-tests/cache-put.js": [
-   "00d90c0901aef4fd65811cde2daa7da027b46251",
+   "4adb09fee2f20630ccc11ec262f49afade08917a",
    "support"
   ],
   "service-workers/cache-storage/script-tests/cache-storage-keys.js": [
    "97180803ef64070584ec51f7ca537e18201f9dd2",
    "support"
   ],
   "service-workers/cache-storage/script-tests/cache-storage-match.js": [
    "e3cc14ea5d0587c43a5b142fca84788383b549cb",
@@ -584090,17 +584090,17 @@
    "43346c7dbd6592a33c35146d7ea6fa4495f9a353",
    "testharness"
   ],
   "service-workers/cache-storage/window/cache-matchAll.https.html": [
    "f39bd1317aca437c9b5fddef2aaae907e05869b2",
    "testharness"
   ],
   "service-workers/cache-storage/window/cache-put.https.html": [
-   "1f0e133e01dc8ff3ede598d978719e775a913183",
+   "ecc29eace78c0ef4e967738add9cceb3d70d37f6",
    "testharness"
   ],
   "service-workers/cache-storage/window/cache-storage-keys.https.html": [
    "6284209cfc1d384c254b0e78c111c5dadbd3baab",
    "testharness"
   ],
   "service-workers/cache-storage/window/cache-storage-match.https.html": [
    "c0cb629ccb3b4ec4ce98474d502c84e461cfce41",
--- a/testing/web-platform/tests/service-workers/cache-storage/script-tests/cache-put.js
+++ b/testing/web-platform/tests/service-workers/cache-storage/script-tests/cache-put.js
@@ -330,9 +330,17 @@ cache_test(function(cache) {
       .then(function(response) {
           assert_response_equals(response, redirectResponse,
                                  'Redirect response is reproduced by the Cache API');
           assert_equals(response.headers.get('Location'), redirectURL,
                         'Location header is preserved by Cache API.');
         });
   }, 'Cache.put should store Response.redirect() correctly');
 
+cache_test(async (cache) => {
+    var request = new Request(test_url);
+    var response = new Response(new Blob([test_body]));
+    await cache.put(request, response);
+    var cachedResponse = await cache.match(request);
+    assert_equals(await cachedResponse.text(), test_body);
+  }, 'Cache.put called with simple Request and blob Response');
+
 done();
--- a/testing/web-platform/tests/service-workers/cache-storage/window/cache-put.https.html
+++ b/testing/web-platform/tests/service-workers/cache-storage/window/cache-put.https.html
@@ -1,8 +1,21 @@
 <!DOCTYPE html>
 <title>Cache Storage: Cache.put</title>
 <link rel="help" href="https://w3c.github.io/ServiceWorker/#cache-put">
 <meta name="timeout" content="long">
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <script src="../resources/test-helpers.js"></script>
 <script src="../script-tests/cache-put.js"></script>
+<script>
+cache_test(async (cache) => {
+    var formData = new FormData();
+    formData.append("name", "value");
+
+    var request = new Request(test_url);
+    var response = new Response(formData);
+    await cache.put(request, response);
+    var cachedResponse = await cache.match(request);
+    var cachedResponseText = await cachedResponse.text();
+    assert_true(cachedResponseText.indexOf("name=\"name\"\r\n\r\nvalue") !== -1);
+  }, 'Cache.put called with simple Request and form data Response');
+</script>