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

Unified Diff: LayoutTests/http/tests/cachestorage/resources/common-worker.js

Issue 1032623008: Expose Cache Storage API in global window/worker scope (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update webexposed expectations Created 5 years, 9 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: LayoutTests/http/tests/cachestorage/resources/common-worker.js
diff --git a/LayoutTests/http/tests/cachestorage/resources/common-worker.js b/LayoutTests/http/tests/cachestorage/resources/common-worker.js
new file mode 100644
index 0000000000000000000000000000000000000000..d0e8544b56c2677a9c60d47a9e8b587d63bc6d6c
--- /dev/null
+++ b/LayoutTests/http/tests/cachestorage/resources/common-worker.js
@@ -0,0 +1,15 @@
+self.onmessage = function(e) {
+ var cache_name = e.data.name;
+
+ self.caches.open(cache_name)
+ .then(function(cache) {
+ return Promise.all([
+ cache.put('https://example.com/a', new Response('a')),
+ cache.put('https://example.com/b', new Response('b')),
+ cache.put('https://example.com/c', new Response('c'))
+ ]);
+ })
+ .then(function() {
+ self.postMessage('ok');
+ });
+};

Powered by Google App Engine
This is Rietveld 408576698