diff options
author | limasdf@gmail.com <limasdf@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-25 09:25:52 +0000 |
---|---|---|
committer | limasdf@gmail.com <limasdf@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-25 09:25:52 +0000 |
commit | 00ee2f5e7cfde91efe3c62ad17f48f2f605644ed (patch) | |
tree | 9c24a5aee4bb2a2c5f39f4a0eaaf4d473c14f120 /chrome/browser/extensions/menu_manager_unittest.cc | |
parent | 5697d7a05ac26fd459058e37a7effde715e7b41c (diff) | |
download | chromium_src-00ee2f5e7cfde91efe3c62ad17f48f2f605644ed.zip chromium_src-00ee2f5e7cfde91efe3c62ad17f48f2f605644ed.tar.gz chromium_src-00ee2f5e7cfde91efe3c62ad17f48f2f605644ed.tar.bz2 |
Remove NOTIFICATION_EXTENSION_LOADED_DEPRECATED from MenuManager.
R=kalman@chromium.org
BUG=354046
TEST=unit_tests
Review URL: https://codereview.chromium.org/250443002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266173 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/menu_manager_unittest.cc')
-rw-r--r-- | chrome/browser/extensions/menu_manager_unittest.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/chrome/browser/extensions/menu_manager_unittest.cc b/chrome/browser/extensions/menu_manager_unittest.cc index 3b16b7f..486c973 100644 --- a/chrome/browser/extensions/menu_manager_unittest.cc +++ b/chrome/browser/extensions/menu_manager_unittest.cc @@ -25,6 +25,7 @@ #include "content/public/common/context_menu_params.h" #include "content/public/test/test_browser_thread.h" #include "extensions/browser/event_router.h" +#include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_system.h" #include "extensions/common/extension.h" #include "testing/gmock/include/gmock/gmock.h" @@ -48,7 +49,9 @@ class MenuManagerTest : public testing::Test { MenuManagerTest() : ui_thread_(BrowserThread::UI, &message_loop_), file_thread_(BrowserThread::FILE, &message_loop_), - manager_(&profile_, ExtensionSystem::Get(&profile_)->state_store()), + profile_(new TestingProfile()), + manager_(profile_.get(), + ExtensionSystem::Get(profile_.get())->state_store()), prefs_(message_loop_.message_loop_proxy().get()), next_id_(1) {} @@ -90,7 +93,7 @@ class MenuManagerTest : public testing::Test { base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; - TestingProfile profile_; + scoped_ptr<TestingProfile> profile_; MenuManager manager_; ExtensionList extensions_; @@ -439,12 +442,10 @@ TEST_F(MenuManagerTest, ExtensionUnloadRemovesMenuItems) { // Notify that the extension was unloaded, and make sure the right item is // gone. - UnloadedExtensionInfo details( - extension1, UnloadedExtensionInfo::REASON_DISABLE); - notifier->Notify(chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, - content::Source<Profile>(&profile_), - content::Details<UnloadedExtensionInfo>( - &details)); + ExtensionRegistry* registry = ExtensionRegistry::Get(profile_.get()); + registry->TriggerOnUnloaded(extension1, + UnloadedExtensionInfo::REASON_DISABLE); + ASSERT_EQ(NULL, manager_.MenuItems(MenuItem::ExtensionKey(extension1->id()))); ASSERT_EQ( 1u, manager_.MenuItems(MenuItem::ExtensionKey(extension2->id()))->size()); |