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

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

Issue 678513002: Service Worker: Remove invalid test case for Cache.put() rejection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/http/tests/serviceworker/cache-put-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 importScripts('worker-testharness.js'); 1 importScripts('worker-testharness.js');
2 importScripts('/resources/testharness-helpers.js'); 2 importScripts('/resources/testharness-helpers.js');
3 3
4 var test_url = 'https://example.com/foo'; 4 var test_url = 'https://example.com/foo';
5 5
6 // Construct a generic Request object. The URL is |test_url|. All other fields 6 // Construct a generic Request object. The URL is |test_url|. All other fields
7 // are defaults. 7 // are defaults.
8 function new_test_request() { 8 function new_test_request() {
9 return new Request(test_url); 9 return new Request(test_url);
10 } 10 }
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 return cache.match(new URL('relative-url', location.href).href); 185 return cache.match(new URL('relative-url', location.href).href);
186 }) 186 })
187 .then(function(result) { 187 .then(function(result) {
188 assert_object_equals(result, response, 188 assert_object_equals(result, response,
189 'Cache.put should accept a relative URL ' + 189 'Cache.put should accept a relative URL ' +
190 'as the request.'); 190 'as the request.');
191 }); 191 });
192 }, 'Cache.put with a relative URL'); 192 }, 'Cache.put with a relative URL');
193 193
194 cache_test(function(cache) { 194 cache_test(function(cache) {
195 var request = new Request('http://example.com/foo', {method: 'get'});
196 return assert_promise_rejects(
197 cache.put(request, new_test_response()),
198 new TypeError(),
199 'Cache.put should throw a TypeError for non-GET requests.');
200 }, 'Cache.put with a non-GET request');
201
202 cache_test(function(cache) {
203 var request = new Request('http://example.com/foo', {method: 'HEAD'}); 195 var request = new Request('http://example.com/foo', {method: 'HEAD'});
204 return assert_promise_rejects( 196 return assert_promise_rejects(
205 cache.put(request, new_test_response()), 197 cache.put(request, new_test_response()),
206 new TypeError(), 198 new TypeError(),
207 'Cache.put should throw a TypeError for non-GET requests.'); 199 'Cache.put should throw a TypeError for non-GET requests.');
208 }, 'Cache.put with a non-GET request'); 200 }, 'Cache.put with a non-GET request');
209 201
210 cache_test(function(cache) { 202 cache_test(function(cache) {
211 return assert_promise_rejects( 203 return assert_promise_rejects(
212 cache.put(new_test_request(), null), 204 cache.put(new_test_request(), null),
213 new TypeError(), 205 new TypeError(),
214 'Cache.put should throw a TypeError for an empty response.'); 206 'Cache.put should throw a TypeError for an empty response.');
215 }, 'Cache.put with an empty response'); 207 }, 'Cache.put with an empty response');
OLDNEW
« 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