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

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

Issue 638023003: [ServiceWorkerCacheStorage] Blink changes to remove create/get and add open function (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update a comment 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 | « no previous file | Source/modules/serviceworkers/CacheStorage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/serviceworker/resources/cache-storage-worker.js
diff --git a/LayoutTests/http/tests/serviceworker/resources/cache-storage-worker.js b/LayoutTests/http/tests/serviceworker/resources/cache-storage-worker.js
index bd0aedc4bc98e665e2968adca32f45784a36d4b3..a7f086990c2c72f4cd10bdfe52872d72072cb091 100644
--- a/LayoutTests/http/tests/serviceworker/resources/cache-storage-worker.js
+++ b/LayoutTests/http/tests/serviceworker/resources/cache-storage-worker.js
@@ -5,13 +5,13 @@ promise_test(function(t) {
var cache_name = 'cache-storage/foo';
return self.caches.delete(cache_name)
.then(function() {
- return self.caches.create(cache_name);
+ return self.caches.open(cache_name);
})
.then(function(cache) {
assert_true(cache instanceof Cache,
- 'CacheStorage.create should return a Cache.');
+ 'CacheStorage.open should return a Cache.');
});
- }, 'CacheStorage.create');
+ }, 'CacheStorage.open');
promise_test(function(t) {
// Note that this test may collide with other tests running in the same
@@ -19,35 +19,20 @@ promise_test(function(t) {
var cache_name = '';
return self.caches.delete(cache_name)
.then(function() {
- return self.caches.create(cache_name);
+ return self.caches.open(cache_name);
})
.then(function(cache) {
assert_true(cache instanceof Cache,
- 'CacheStorage.create should accept an empty name.');
+ 'CacheStorage.open should accept an empty name.');
falken 2014/10/17 01:54:27 Do you understand why service_worker.js and servic
jkarlin 2014/10/17 02:05:49 We have a bug on the issue where we discuss that e
});
- }, 'CacheStorage.create with an empty name');
+ }, 'CacheStorage.open with an empty name');
promise_test(function(t) {
return assert_promise_rejects(
- self.caches.create(),
+ self.caches.open(),
new TypeError(),
- 'CacheStorage.create should throw TypeError if called with no arguments.');
- }, 'CacheStorage.create with no arguments');
-
-promise_test(function(t) {
- var cache_name = 'cache-storage/there can be only one';
- return self.caches.delete(cache_name)
- .then(function() {
- return self.caches.create(cache_name);
- })
- .then(function() {
- return assert_promise_rejects(
- self.caches.create(cache_name),
- 'InvalidAccessError',
- 'CacheStorage.create should throw InvalidAccessError if called ' +
- 'with existing cache name.');
- });
- }, 'CacheStorage.create with an existing cache name');
+ 'CacheStorage.open should throw TypeError if called with no arguments.');
+ }, 'CacheStorage.open with no arguments');
promise_test(function(t) {
var test_cases = [
@@ -80,7 +65,7 @@ promise_test(function(t) {
var cache_name = testcase.name;
return self.caches.delete(cache_name)
.then(function() {
- return self.caches.create(cache_name);
+ return self.caches.open(cache_name);
})
.then(function() {
return self.caches.has(cache_name);
@@ -117,48 +102,39 @@ promise_test(function(t) {
}, 'CacheStorage.has with nonexistent cache');
promise_test(function(t) {
- var cache_name = 'cache-storage/get';
+ var cache_name = 'cache-storage/open';
var cache;
return self.caches.delete(cache_name)
.then(function() {
- return self.caches.create(cache_name);
+ return self.caches.open(cache_name);
})
.then(function(result) {
cache = result;
})
.then(function() {
- return self.caches.get(cache_name);
+ return self.caches.open(cache_name);
})
.then(function(result) {
assert_equals(result, cache,
- 'CacheStorage.get should return the named Cache ' +
+ 'CacheStorage.open should return the named Cache ' +
'object if it exists.');
})
.then(function() {
- return self.caches.get(cache_name);
+ return self.caches.open(cache_name);
})
.then(function(result) {
assert_equals(result, cache,
- 'CacheStorage.get should return the same ' +
+ 'CacheStorage.open should return the same ' +
'instance of an existing Cache object.');
});
- }, 'CacheStorage.get with existing cache');
-
-promise_test(function(t) {
- return self.caches.get('cheezburger')
- .then(function(result) {
- assert_equals(result, undefined,
- 'CacheStorage.get should return undefined for a ' +
- 'nonexistent cache.');
- });
- }, 'CacheStorage.get with nonexistent cache');
+ }, 'CacheStorage.open with existing cache');
promise_test(function(t) {
var cache_name = 'cache-storage/delete';
return self.caches.delete(cache_name)
.then(function() {
- return self.caches.create(cache_name);
+ return self.caches.open(cache_name);
})
.then(function() { return self.caches.delete(cache_name); })
.then(function(result) {
« no previous file with comments | « no previous file | Source/modules/serviceworkers/CacheStorage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698