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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-storage.js

Issue 1485283002: Sync Cache API tests w/ web-platform-tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/http/tests/cachestorage/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/http/tests/cachestorage/script-tests/cache-storage.js
index 1e3280c99ed0a35fbb3dec36c2afb6265e5b4ff5..559a787afc312d49dac60e2653b69be99becc112 100644
--- a/third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-storage.js
+++ b/third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-storage.js
@@ -115,20 +115,25 @@ promise_test(function(t) {
cache = result;
})
.then(function() {
- return self.caches.open(cache_name);
- })
- .then(function(result) {
- assert_equals(result, cache,
- 'CacheStorage.open should return the named Cache ' +
- 'object if it exists.');
+ return cache.add('../resources/simple.txt');
})
.then(function() {
return self.caches.open(cache_name);
})
.then(function(result) {
- assert_equals(result, cache,
- 'CacheStorage.open should return the same ' +
- 'instance of an existing Cache object.');
+ assert_true(result instanceof Cache,
+ 'CacheStorage.open should return a Cache object');
+ assert_not_equals(result, cache,
+ 'CacheStorage.open should return a new Cache ' +
+ 'object each time its called.');
+ return Promise.all([cache.keys(), result.keys()]);
+ })
+ .then(function(results) {
+ var expected_urls = results[0].map(function(r) { return r.url });
+ var actual_urls = results[1].map(function(r) { return r.url });
+ assert_array_equals(actual_urls, expected_urls,
+ 'CacheStorage.open should return a new Cache ' +
+ 'object for the same backing store.');
});
}, 'CacheStorage.open with existing cache');

Powered by Google App Engine
This is Rietveld 408576698