Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Unified Diff: LayoutTests/http/tests/serviceworker/resources/cache-put-worker.js

Issue 677533002: Update Cache.put() test to accept string as request (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/http/tests/serviceworker/cache-put-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/serviceworker/resources/cache-put-worker.js
diff --git a/LayoutTests/http/tests/serviceworker/resources/cache-put-worker.js b/LayoutTests/http/tests/serviceworker/resources/cache-put-worker.js
index c8af0230afdbfccacff3f24df3197f926b15dae6..124037222baac3dc59c15d45d31bff0f8408cf07 100644
--- a/LayoutTests/http/tests/serviceworker/resources/cache-put-worker.js
+++ b/LayoutTests/http/tests/serviceworker/resources/cache-put-worker.js
@@ -154,11 +154,15 @@ cache_test(function(cache) {
}, 'Cache.put called twice with same Request and different Responses');
cache_test(function(cache) {
- return assert_promise_rejects(
- cache.put('http://example.com/foo', new_test_response()),
- new TypeError(),
- 'Cache.put should only accept a Request object as the request.');
- }, 'Cache.put with an invalid request');
+ var url = 'http://example.com/foo';
+ return cache.put(url, new_test_response('some body'))
+ .then(function() { return cache.match(url); })
+ .then(function(response) { return response.text(); })
+ .then(function(body) {
+ assert_equals(body, 'some body',
+ 'Cache.put should accept a string as request');
asanka 2014/10/24 04:59:07 Minor nit: I've been including the ending period i
+ });
+ }, 'Cache.put with an string request');
cache_test(function(cache) {
return assert_promise_rejects(
« no previous file with comments | « LayoutTests/http/tests/serviceworker/cache-put-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698