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

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

Issue 1006753003: Add time from navigation_start to NTP LogEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 81096d02aa49cd084e8b28a37e24ed6b764dd730..584cd28c808d7385b94c932053860783dd9273be 100644
--- a/chrome/browser/ui/search/search_ipc_router_unittest.cc
+++ b/chrome/browser/ui/search/search_ipc_router_unittest.cc
@@ -52,7 +52,7 @@ class MockSearchIPCRouterDelegate : public SearchIPCRouter::Delegate {
MOCK_METHOD1(OnDeleteMostVisitedItem, void(const GURL& url));
MOCK_METHOD1(OnUndoMostVisitedDeletion, void(const GURL& url));
MOCK_METHOD0(OnUndoAllMostVisitedDeletions, void());
- MOCK_METHOD1(OnLogEvent, void(NTPLoggingEventType event));
+ MOCK_METHOD2(OnLogEvent, void(NTPLoggingEventType event, uint64 time));
MOCK_METHOD2(OnLogMostVisitedImpression,
void(int position, const base::string16& provider));
MOCK_METHOD2(OnLogMostVisitedNavigation,
@@ -345,26 +345,26 @@ TEST_F(SearchIPCRouterTest, ProcessLogEventMsg) {
NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl));
SetupMockDelegateAndPolicy();
MockSearchIPCRouterPolicy* policy = GetSearchIPCRouterPolicy();
- EXPECT_CALL(*mock_delegate(), OnLogEvent(NTP_MOUSEOVER)).Times(1);
+ EXPECT_CALL(*mock_delegate(), OnLogEvent(NTP_MOUSEOVER, 123)).Times(1);
EXPECT_CALL(*policy, ShouldProcessLogEvent()).Times(1)
.WillOnce(testing::Return(true));
content::WebContents* contents = web_contents();
OnMessageReceived(ChromeViewHostMsg_LogEvent(
- contents->GetRoutingID(), GetSearchIPCRouterSeqNo(), NTP_MOUSEOVER));
+ contents->GetRoutingID(), GetSearchIPCRouterSeqNo(), NTP_MOUSEOVER, 123));
}
TEST_F(SearchIPCRouterTest, IgnoreLogEventMsg) {
NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar"));
SetupMockDelegateAndPolicy();
MockSearchIPCRouterPolicy* policy = GetSearchIPCRouterPolicy();
- EXPECT_CALL(*mock_delegate(), OnLogEvent(NTP_MOUSEOVER)).Times(0);
+ EXPECT_CALL(*mock_delegate(), OnLogEvent(NTP_MOUSEOVER, 123)).Times(0);
EXPECT_CALL(*policy, ShouldProcessLogEvent()).Times(1)
.WillOnce(testing::Return(false));
content::WebContents* contents = web_contents();
OnMessageReceived(ChromeViewHostMsg_LogEvent(
- contents->GetRoutingID(), GetSearchIPCRouterSeqNo(), NTP_MOUSEOVER));
+ contents->GetRoutingID(), GetSearchIPCRouterSeqNo(), NTP_MOUSEOVER, 123));
}
TEST_F(SearchIPCRouterTest, ProcessLogMostVisitedImpressionMsg) {
@@ -574,10 +574,10 @@ TEST_F(SearchIPCRouterTest, IgnoreMessageIfThePageIsNotActive) {
OnMessageReceived(ChromeViewHostMsg_FocusOmnibox(
contents->GetRoutingID(), page_seq_no, OMNIBOX_FOCUS_VISIBLE));
- EXPECT_CALL(*mock_delegate(), OnLogEvent(NTP_MOUSEOVER)).Times(0);
+ EXPECT_CALL(*mock_delegate(), OnLogEvent(NTP_MOUSEOVER, 12)).Times(0);
EXPECT_CALL(*policy, ShouldProcessLogEvent()).Times(0);
- OnMessageReceived(ChromeViewHostMsg_LogEvent(
- contents->GetRoutingID(), page_seq_no, NTP_MOUSEOVER));
+ OnMessageReceived(ChromeViewHostMsg_LogEvent(contents->GetRoutingID(),
+ page_seq_no, NTP_MOUSEOVER, 12));
base::string16 text;
EXPECT_CALL(*mock_delegate(), PasteIntoOmnibox(text)).Times(0);

Powered by Google App Engine
This is Rietveld 408576698