summaryrefslogtreecommitdiffstats
path: root/extensions/browser/process_manager_unittest.cc
diff options
context:
space:
mode:
authorjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-31 12:44:06 +0000
committerjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-31 12:44:06 +0000
commitadf5a10eeb5dc230f27d3b1344f2111bdfcd97d6 (patch)
tree8ba5fbfcb3ddaa54355fa3b03cbdcadcbc6d875d /extensions/browser/process_manager_unittest.cc
parent248ee9be3db637800a1bf7b13817df43f904248b (diff)
downloadchromium_src-adf5a10eeb5dc230f27d3b1344f2111bdfcd97d6.zip
chromium_src-adf5a10eeb5dc230f27d3b1344f2111bdfcd97d6.tar.gz
chromium_src-adf5a10eeb5dc230f27d3b1344f2111bdfcd97d6.tar.bz2
Move extension notifications to extensions/browser/notification_types.h
As part of the extensions module refactor we temporarily allowed the use of chrome_notification_types.h in src/extensions. However, this allowed code moving into src/extensions to listen to notifications from Chrome, which was a layering violation. This CL moves all the extensions notifications into their own header and cleans up DEPS to disallow the exception. BUG=392622 TEST=compiles, unit_tests, browser_tests, extensions_unittests TBR=miket@chromium.org for apps/ Review URL: https://codereview.chromium.org/425303002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286770 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions/browser/process_manager_unittest.cc')
-rw-r--r--extensions/browser/process_manager_unittest.cc32
1 files changed, 17 insertions, 15 deletions
diff --git a/extensions/browser/process_manager_unittest.cc b/extensions/browser/process_manager_unittest.cc
index 3848d1c..e04b0d3 100644
--- a/extensions/browser/process_manager_unittest.cc
+++ b/extensions/browser/process_manager_unittest.cc
@@ -4,7 +4,6 @@
#include "extensions/browser/process_manager.h"
-#include "chrome/browser/chrome_notification_types.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/site_instance.h"
@@ -12,6 +11,7 @@
#include "content/public/test/test_browser_context.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extensions_test.h"
+#include "extensions/browser/notification_types.h"
#include "extensions/browser/process_manager_delegate.h"
#include "extensions/browser/test_extensions_browser_client.h"
@@ -108,16 +108,17 @@ TEST_F(ProcessManagerTest, ExtensionNotificationRegistration) {
// It observes other notifications from this context.
EXPECT_TRUE(IsRegistered(manager1.get(),
- chrome::NOTIFICATION_EXTENSIONS_READY,
+ extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
original_context()));
EXPECT_TRUE(IsRegistered(manager1.get(),
- chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
+ extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
original_context()));
+ EXPECT_TRUE(
+ IsRegistered(manager1.get(),
+ extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
+ original_context()));
EXPECT_TRUE(IsRegistered(manager1.get(),
- chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
- original_context()));
- EXPECT_TRUE(IsRegistered(manager1.get(),
- chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
+ extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
original_context()));
// Test for an incognito context ProcessManager.
@@ -132,18 +133,19 @@ TEST_F(ProcessManagerTest, ExtensionNotificationRegistration) {
// Some notifications are observed for the original context.
EXPECT_TRUE(IsRegistered(manager2.get(),
- chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
+ extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
original_context()));
// Some notifications are observed for the incognito context.
EXPECT_TRUE(IsRegistered(manager2.get(),
- chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
+ extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
incognito_context()));
// Some are not observed at all.
- EXPECT_FALSE(IsRegistered(manager2.get(),
- chrome::NOTIFICATION_EXTENSIONS_READY,
- original_context()));
+ EXPECT_FALSE(
+ IsRegistered(manager2.get(),
+ extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
+ original_context()));
}
// Test that startup background hosts are created when the extension system
@@ -159,7 +161,7 @@ TEST_F(ProcessManagerTest, CreateBackgroundHostsOnExtensionsReady) {
// Simulate the extension system becoming ready.
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSIONS_READY,
+ extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
content::Source<BrowserContext>(original_context()),
content::NotificationService::NoDetails());
EXPECT_TRUE(manager->startup_background_hosts_created_for_test());
@@ -192,7 +194,7 @@ TEST_F(ProcessManagerTest, CreateBackgroundHostsDeferred) {
// The extension system becoming ready still doesn't create the hosts.
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSIONS_READY,
+ extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
content::Source<BrowserContext>(original_context()),
content::NotificationService::NoDetails());
EXPECT_FALSE(manager->startup_background_hosts_created_for_test());
@@ -217,7 +219,7 @@ TEST_F(ProcessManagerTest, IsBackgroundHostAllowed) {
// The extension system becoming ready still doesn't create the hosts.
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSIONS_READY,
+ extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
content::Source<BrowserContext>(original_context()),
content::NotificationService::NoDetails());
EXPECT_FALSE(manager->startup_background_hosts_created_for_test());