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

Unified Diff: chrome/test/data/extensions/api_test/events_are_unregistered/page1.js

Issue 1074273002: Move the event attach/detach logic on unload from event.js to (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: being process of relanding - more test assertions Created 5 years, 8 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: chrome/test/data/extensions/api_test/events_are_unregistered/page1.js
diff --git a/chrome/test/data/extensions/api_test/events_are_unregistered/page1.js b/chrome/test/data/extensions/api_test/events_are_unregistered/page1.js
new file mode 100644
index 0000000000000000000000000000000000000000..c5ea62ebdcd2a7078eac8ab55303fb3256ea695f
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/events_are_unregistered/page1.js
@@ -0,0 +1,24 @@
+// 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.
+
+// Register for events in 4 configurations, then navigate to page2.html, which
+// will notify success and succeed the test on the C++ side. The C++ code
+// asserts that the events have been unregistered.
+
+// A single listener.
+chrome.browserAction.onClicked.addListener(function() {});
+// Multiple listeners for the same event.
+chrome.runtime.onStartup.addListener(function() {});
+chrome.runtime.onStartup.addListener(function() {});
+// A single listener, which previously had multiple listeners.
+chrome.runtime.onSuspend.addListener(function() {});
+chrome.runtime.onSuspend.addListener(function() {});
+chrome.runtime.onSuspend.removeListener(function() {});
+// No listeners, which previously had listeners (all were removed).
+chrome.runtime.onInstalled.addListener(function() {});
+chrome.runtime.onInstalled.addListener(function() {});
+chrome.runtime.onInstalled.removeListener(function() {});
+chrome.runtime.onInstalled.removeListener(function() {});
+
+location.assign('page2.html');

Powered by Google App Engine
This is Rietveld 408576698