| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // Register for events in 4 configurations, then navigate to page2.html, which | |
| 6 // will notify success and succeed the test on the C++ side. The C++ code | |
| 7 // asserts that the events have been unregistered. | |
| 8 | |
| 9 // A single listener. | |
| 10 chrome.browserAction.onClicked.addListener(function() {}); | |
| 11 // Multiple listeners for the same event. | |
| 12 chrome.runtime.onStartup.addListener(function() {}); | |
| 13 chrome.runtime.onStartup.addListener(function() {}); | |
| 14 // A single listener, which previously had multiple listeners. | |
| 15 chrome.runtime.onSuspend.addListener(function() {}); | |
| 16 chrome.runtime.onSuspend.addListener(function() {}); | |
| 17 chrome.runtime.onSuspend.removeListener(function() {}); | |
| 18 // No listeners, which previously had listeners (all were removed). | |
| 19 chrome.runtime.onInstalled.addListener(function() {}); | |
| 20 chrome.runtime.onInstalled.addListener(function() {}); | |
| 21 chrome.runtime.onInstalled.removeListener(function() {}); | |
| 22 chrome.runtime.onInstalled.removeListener(function() {}); | |
| 23 | |
| 24 location.assign('page2.html'); | |
| OLD | NEW |