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

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: Adding and using logNavigation(); updating tests; removing ping and the log.html page. Created 6 years, 10 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..7eb9a47fbc4b82a35d2676bc0670a9c2e1a6c798 100644
--- a/chrome/browser/ui/search/search_ipc_router_unittest.cc
+++ b/chrome/browser/ui/search/search_ipc_router_unittest.cc
@@ -54,6 +54,8 @@ class MockSearchIPCRouterDelegate : public SearchIPCRouter::Delegate {
MOCK_METHOD1(OnLogEvent, void(NTPLoggingEventType event));
MOCK_METHOD2(OnLogImpression, void(int position,
const base::string16& provider));
+ MOCK_METHOD2(OnLogNavigation, void(int position,
+ const base::string16& provider));
MOCK_METHOD1(PasteIntoOmnibox, void(const base::string16&));
MOCK_METHOD1(OnChromeIdentityCheck, void(const base::string16& identity));
};
@@ -374,6 +376,24 @@ TEST_F(SearchIPCRouterTest, ProcessLogImpressionMsg) {
OnMessageReceived(*message);
}
+TEST_F(SearchIPCRouterTest, ProcessLogNavigationMsg) {
+ NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl));
+ SetupMockDelegateAndPolicy();
+ MockSearchIPCRouterPolicy* policy = GetSearchIPCRouterPolicy();
+ EXPECT_CALL(*mock_delegate(),
+ OnLogNavigation(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_LogNavigation(
+ contents->GetRoutingID(),
+ contents->GetController().GetVisibleEntry()->GetPageID(),
+ 3,
+ base::ASCIIToUTF16("Server")));
+ OnMessageReceived(*message);
+}
+
TEST_F(SearchIPCRouterTest, ProcessChromeIdentityCheckMsg) {
NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl));
SetupMockDelegateAndPolicy();

Powered by Google App Engine
This is Rietveld 408576698