diff options
author | Ms2ger <Ms2ger@gmail.com> | 2017-02-06 11:06:12 +0100 |
---|---|---|
committer | Ms2ger <Ms2ger@gmail.com> | 2017-02-06 22:38:29 +0100 |
commit | 296fa2512ba2fbc8f1d6b7e82e30ad3b5d2a9a20 (patch) | |
tree | 95ac50cd05fa8a22d1c0fa12016ee0d2012a165c /tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-match.js | |
parent | fb4f421c8b9cbf80a86c9c5eb88395d7008b27a1 (diff) | |
download | servo-296fa2512ba2fbc8f1d6b7e82e30ad3b5d2a9a20.tar.gz servo-296fa2512ba2fbc8f1d6b7e82e30ad3b5d2a9a20.zip |
Update web-platform-tests and CSS tests.
- Update CSS tests to revision e05bfd5e30ed662c2f8a353577003f8eed230180.
- Update web-platform-tests to revision a052787dd5c069a340031011196b73affbd68cd9.
Diffstat (limited to 'tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-match.js')
-rw-r--r-- | tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-match.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-match.js b/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-match.js index fbe564d952d..32c9ec92a69 100644 --- a/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-match.js +++ b/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-match.js @@ -36,6 +36,14 @@ prepopulated_cache_test(simple_entries, function(cache, entries) { }, 'Cache.match with new Request'); prepopulated_cache_test(simple_entries, function(cache, entries) { + return cache.match(new Request(entries.a.request.url, {method: 'HEAD'})) + .then(function(result) { + assert_equals(result, undefined, + 'Cache.match should not match HEAD Request.'); + }); + }, 'Cache.match with HEAD'); + +prepopulated_cache_test(simple_entries, function(cache, entries) { return cache.match(entries.a.request, {ignoreSearch: true}) .then(function(result) { @@ -189,4 +197,28 @@ prepopulated_cache_test(simple_entries, function(cache, entries) { }); }, 'Cache.match with a network error Response'); +cache_test(function(cache) { + // This test validates that we can get a Response from the Cache API, + // clone it, and read just one side of the clone. This was previously + // bugged in FF for Responses with large bodies. + var data = []; + data.length = 80 * 1024; + data.fill('F'); + var response; + return cache.put('/', new Response(data.toString())) + .then(function(result) { + return cache.match('/'); + }) + .then(function(r) { + // Make sure the original response is not GC'd. + response = r; + // Return only the clone. We purposefully test that the other + // half of the clone does not need to be read here. + return response.clone().text(); + }) + .then(function(text) { + assert_equals(text, data.toString(), 'cloned body text can be read correctly'); + }) + }, 'Cache produces large Responses that can be cloned and read correctly.'); + done(); |