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

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

Issue 2520093002: Make Cache Storage tests resilient to execution order (Closed)
Patch Set: Rename string, add comment and helper Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/cachestorage/resources/test-helpers.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 673cf50f01ca85146983862c9de6bb81967c6002..dd5e39d91e124c9df59bd41d123d81868019a28b 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
@@ -203,20 +203,28 @@ promise_test(function(t) {
}, 'CacheStorage.delete with nonexistent cache');
promise_test(function(t) {
- var bad_name = 'unpaired\uD800';
- var converted_name = 'unpaired\uFFFD'; // Don't create cache with this name.
- return self.caches.has(converted_name)
+ var unpaired_name = 'unpaired\uD800';
+ var converted_name = 'unpaired\uFFFD';
+
+ // The test assumes that a cache with converted_name does not
+ // exist, but if the implementation fails the test then such
+ // a cache will be created. Start off in a fresh state by
+ // deleting all caches.
+ return delete_all_caches()
jkarlin 2016/11/22 18:20:40 Why not have promise_test run delete_all_caches at
jsbell 2016/11/22 18:34:14 promise_test is generic (part of testharness.js);
+ .then(function() {
+ return self.caches.has(converted_name);
+ })
.then(function(cache_exists) {
assert_false(cache_exists,
'Test setup failure: cache should not exist');
})
- .then(function() { return self.caches.open(bad_name); })
+ .then(function() { return self.caches.open(unpaired_name); })
.then(function() { return self.caches.keys(); })
.then(function(keys) {
- assert_true(keys.indexOf(bad_name) !== -1,
+ assert_true(keys.indexOf(unpaired_name) !== -1,
'keys should include cache with bad name');
})
- .then(function() { return self.caches.has(bad_name); })
+ .then(function() { return self.caches.has(unpaired_name); })
.then(function(cache_exists) {
assert_true(cache_exists,
'CacheStorage names should be not be converted.');
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/cachestorage/resources/test-helpers.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698