| Index: chrome/browser/ui/search/search_ipc_router_unittest.cc
|
| diff --git a/chrome/browser/ui/search/search_ipc_router_unittest.cc b/chrome/browser/ui/search/search_ipc_router_unittest.cc
|
| index b0418d8ef3093ed5067401e5e2dd71a06c65cf65..61e55579447be704d16b15a5e1aa1b95e86c218e 100644
|
| --- a/chrome/browser/ui/search/search_ipc_router_unittest.cc
|
| +++ b/chrome/browser/ui/search/search_ipc_router_unittest.cc
|
| @@ -52,8 +52,10 @@ class MockSearchIPCRouterDelegate : public SearchIPCRouter::Delegate {
|
| MOCK_METHOD1(OnUndoMostVisitedDeletion, void(const GURL& url));
|
| MOCK_METHOD0(OnUndoAllMostVisitedDeletions, void());
|
| MOCK_METHOD1(OnLogEvent, void(NTPLoggingEventType event));
|
| - MOCK_METHOD2(OnLogImpression, void(int position,
|
| - const base::string16& provider));
|
| + MOCK_METHOD2(OnLogMostVisitedImpression,
|
| + void(int position, const base::string16& provider));
|
| + MOCK_METHOD2(OnLogMostVisitedNavigation,
|
| + void(int position, const base::string16& provider));
|
| MOCK_METHOD1(PasteIntoOmnibox, void(const base::string16&));
|
| MOCK_METHOD1(OnChromeIdentityCheck, void(const base::string16& identity));
|
| };
|
| @@ -356,17 +358,37 @@ TEST_F(SearchIPCRouterTest, IgnoreLogEventMsg) {
|
| OnMessageReceived(*message);
|
| }
|
|
|
| -TEST_F(SearchIPCRouterTest, ProcessLogImpressionMsg) {
|
| +TEST_F(SearchIPCRouterTest, ProcessLogMostVisitedImpressionMsg) {
|
| NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl));
|
| SetupMockDelegateAndPolicy();
|
| MockSearchIPCRouterPolicy* policy = GetSearchIPCRouterPolicy();
|
| EXPECT_CALL(*mock_delegate(),
|
| - OnLogImpression(3, base::ASCIIToUTF16("Server"))).Times(1);
|
| + OnLogMostVisitedImpression(3, base::ASCIIToUTF16("Server"))).Times(1);
|
| EXPECT_CALL(*policy, ShouldProcessLogEvent()).Times(1)
|
| .WillOnce(testing::Return(true));
|
|
|
| content::WebContents* contents = web_contents();
|
| - scoped_ptr<IPC::Message> message(new ChromeViewHostMsg_LogImpression(
|
| + scoped_ptr<IPC::Message> message(
|
| + new ChromeViewHostMsg_LogMostVisitedImpression(
|
| + contents->GetRoutingID(),
|
| + contents->GetController().GetVisibleEntry()->GetPageID(),
|
| + 3,
|
| + base::ASCIIToUTF16("Server")));
|
| + OnMessageReceived(*message);
|
| +}
|
| +
|
| +TEST_F(SearchIPCRouterTest, ProcessLogMostVisitedNavigationMsg) {
|
| + NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl));
|
| + SetupMockDelegateAndPolicy();
|
| + MockSearchIPCRouterPolicy* policy = GetSearchIPCRouterPolicy();
|
| + EXPECT_CALL(*mock_delegate(),
|
| + OnLogMostVisitedNavigation(3, base::ASCIIToUTF16("Server"))).Times(1);
|
| + EXPECT_CALL(*policy, ShouldProcessLogEvent()).Times(1)
|
| + .WillOnce(testing::Return(true));
|
| +
|
| + content::WebContents* contents = web_contents();
|
| + scoped_ptr<IPC::Message> message(
|
| + new ChromeViewHostMsg_LogMostVisitedNavigation(
|
| contents->GetRoutingID(),
|
| contents->GetController().GetVisibleEntry()->GetPageID(),
|
| 3,
|
|
|