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

Unified Diff: chrome/browser/ui/search/search_ipc_router_unittest.cc

Issue 178253008: Redoing Issue 36073011: Allowing file:/// in Instant Extended's Most Visited links. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unused consts. Created 6 years, 9 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
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,

Powered by Google App Engine
This is Rietveld 408576698