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

Unified Diff: content/test/data/service_worker/worker_message_to_self.js

Issue 2506263005: Prevent a service worker from keeping itself alive by self postMessage. (Closed)
Patch Set: fix unit test 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
Index: content/test/data/service_worker/worker_message_to_self.js
diff --git a/content/test/data/service_worker/worker_message_to_self.js b/content/test/data/service_worker/worker_message_to_self.js
new file mode 100644
index 0000000000000000000000000000000000000000..1de40704d9969eb48e5f5c9f7797467ad21530d2
--- /dev/null
+++ b/content/test/data/service_worker/worker_message_to_self.js
@@ -0,0 +1,12 @@
+// Copyright 2016 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.
+
+this.onactivate = function(event) {
+ self.registration.active.postMessage('foo');
+};
+
+this.onmessage = function(event) {
+ console.log("MESSAGE");
+ self.registration.active.postMessage('foo');
+};

Powered by Google App Engine
This is Rietveld 408576698