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

Unified Diff: chrome/browser/extensions/menu_manager_unittest.cc

Issue 250443002: Remove NOTIFICATION_EXTENSION_LOADED_DEPRECATED from MenuManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « chrome/browser/extensions/menu_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/menu_manager_unittest.cc
diff --git a/chrome/browser/extensions/menu_manager_unittest.cc b/chrome/browser/extensions/menu_manager_unittest.cc
index 3b16b7fa49cc02cbfa94547b9ad5ca1925133bbe..486c973541c61a33798e06bd56d23f44e2e7174b 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());
« no previous file with comments | « chrome/browser/extensions/menu_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698