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

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/service-workers/cache-storage/script-tests/cache-storage.js

Issue 2415873002: Import w3c tests for the service workers (Closed)
Patch Set: Created 4 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
Index: third_party/WebKit/LayoutTests/imported/wpt/service-workers/cache-storage/script-tests/cache-storage.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-storage.js b/third_party/WebKit/LayoutTests/imported/wpt/service-workers/cache-storage/script-tests/cache-storage.js
similarity index 86%
copy from third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-storage.js
copy to third_party/WebKit/LayoutTests/imported/wpt/service-workers/cache-storage/script-tests/cache-storage.js
index 673cf50f01ca85146983862c9de6bb81967c6002..594b01b5810cd8048550ac0567f924d695465b40 100644
--- a/third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-storage.js
+++ b/third_party/WebKit/LayoutTests/imported/wpt/service-workers/cache-storage/script-tests/cache-storage.js
@@ -1,5 +1,6 @@
if (self.importScripts) {
importScripts('/resources/testharness.js');
+ importScripts('../resources/testharness-helpers.js');
importScripts('../resources/test-helpers.js');
}
@@ -16,40 +17,6 @@ promise_test(function(t) {
}, 'CacheStorage.open');
promise_test(function(t) {
- var cache_name = 'cache-storage/bar';
- var first_cache = null;
- var second_cache = null;
- return self.caches.open(cache_name)
- .then(function(cache) {
- first_cache = cache;
- return self.caches.delete(cache_name);
- })
- .then(function() {
- return first_cache.add('../resources/simple.txt');
- })
- .then(function() {
- return self.caches.keys();
- })
- .then(function(cache_names) {
- assert_equals(cache_names.indexOf(cache_name), -1);
- return self.caches.open(cache_name);
- })
- .then(function(cache) {
- second_cache = cache;
- return second_cache.keys();
- })
- .then(function(keys) {
- assert_equals(keys.length, 0);
- return first_cache.keys();
- })
- .then(function(keys) {
- assert_equals(keys.length, 1);
- // Clean up
- return self.caches.delete(cache_name);
- })
- }, 'CacheStorage.delete dooms');
-
-promise_test(function(t) {
// Note that this test may collide with other tests running in the same
// origin that also uses an empty cache name.
var cache_name = '';
@@ -64,10 +31,9 @@ promise_test(function(t) {
}, 'CacheStorage.open with an empty name');
promise_test(function(t) {
- return promise_rejects(
- t,
- new TypeError(),
+ return assert_promise_rejects(
self.caches.open(),
+ new TypeError(),
'CacheStorage.open should throw TypeError if called with no arguments.');
}, 'CacheStorage.open with no arguments');

Powered by Google App Engine
This is Rietveld 408576698