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

Unified Diff: chrome/test/data/extensions/api_test/service_worker/web_accessible_resources/iframe_src/background.js

Issue 1532633003: Extension SW: Add tests that serve web_accessible_resources from a SW. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: foo 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: chrome/test/data/extensions/api_test/service_worker/web_accessible_resources/iframe_src/background.js
diff --git a/chrome/test/data/extensions/api_test/service_worker/web_accessible_resources/iframe_src/background.js b/chrome/test/data/extensions/api_test/service_worker/web_accessible_resources/iframe_src/background.js
new file mode 100644
index 0000000000000000000000000000000000000000..a3555049d081da6f4881ef739ec2d4eb20d65fe0
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/service_worker/web_accessible_resources/iframe_src/background.js
@@ -0,0 +1,15 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+window.registerServiceWorker = function() {
+ navigator.serviceWorker.register('sw.js').then(function(registration) {
+ return navigator.serviceWorker.ready;
+ }).then(function(registration) {
+ chrome.test.sendMessage('SW_READY');
+ }).catch(function(err) {
+ chrome.test.log('SW registration failure: ' + err);
+ chrome.test.sendMessage('SW_FAILED');
+ });
+ return "true";
+};

Powered by Google App Engine
This is Rietveld 408576698