From a7ab1b782edde4b8558ccba857ea64cb1e8e8d1c Mon Sep 17 00:00:00 2001 From: "mpcomplete@chromium.org" Date: Thu, 21 Oct 2010 23:24:16 +0000 Subject: Part 2 of extension event refactor. Extension events are no longer broadcast to an entire process. They are filtered by extension. This allows me to move the cross-incognito check into the browser, and remove a bunch of cruft associated with that. BUG=58214 TEST=no functional change Review URL: http://codereview.chromium.org/3775015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63448 0039d316-1c4b-4281-b951-d872f2087c98 --- .../extensions/extension_menu_manager_unittest.cc | 23 ++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'chrome/browser/extensions/extension_menu_manager_unittest.cc') diff --git a/chrome/browser/extensions/extension_menu_manager_unittest.cc b/chrome/browser/extensions/extension_menu_manager_unittest.cc index 3dc6f69..0b653ba 100644 --- a/chrome/browser/extensions/extension_menu_manager_unittest.cc +++ b/chrome/browser/extensions/extension_menu_manager_unittest.cc @@ -336,10 +336,11 @@ class MockExtensionEventRouter : public ExtensionEventRouter { explicit MockExtensionEventRouter(Profile* profile) : ExtensionEventRouter(profile) {} - MOCK_METHOD4(DispatchEventToRenderers, void(const std::string& event_name, - const std::string& event_args, - Profile* source_profile, - const GURL& event_url)); + MOCK_METHOD5(DispatchEventImpl, void(const std::string& extension_id, + const std::string& event_name, + const std::string& event_args, + Profile* source_profile, + const GURL& event_url)); private: DISALLOW_COPY_AND_ASSIGN(MockExtensionEventRouter); @@ -414,15 +415,17 @@ TEST_F(ExtensionMenuManagerTest, ExecuteCommand) { .WillOnce(Return(mock_event_router.get())); // Use the magic of googlemock to save a parameter to our mock's - // DispatchEventToRenderers method into event_args. + // DispatchEventImpl method into event_args. std::string event_args; - std::string expected_event_name = "contextMenus/" + item->extension_id(); + std::string expected_event_name = "contextMenus"; EXPECT_CALL(*mock_event_router.get(), - DispatchEventToRenderers(expected_event_name, _, - &profile, - GURL())) + DispatchEventImpl(item->extension_id(), + expected_event_name, + _, + &profile, + GURL())) .Times(1) - .WillOnce(SaveArg<1>(&event_args)); + .WillOnce(SaveArg<2>(&event_args)); manager_.ExecuteCommand(&profile, NULL /* tab_contents */, params, id); -- cgit v1.1