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

Side by Side Diff: chrome/browser/ui/search/search_ipc_router_policy_unittest.cc

Issue 701973002: Separate checking the user identity and checking if the user is syncing his history in two differen… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Answered kmadhusu and dcheng Created 6 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/search/search_ipc_router.h" 5 #include "chrome/browser/ui/search/search_ipc_router.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "chrome/browser/ui/search/search_ipc_router_policy_impl.h" 9 #include "chrome/browser/ui/search/search_ipc_router_policy_impl.h"
10 #include "chrome/browser/ui/search/search_tab_helper.h" 10 #include "chrome/browser/ui/search/search_tab_helper.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl)); 101 NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl));
102 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldProcessChromeIdentityCheck()); 102 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldProcessChromeIdentityCheck());
103 } 103 }
104 104
105 TEST_F(SearchIPCRouterPolicyTest, DoNotProcessChromeIdentityCheck) { 105 TEST_F(SearchIPCRouterPolicyTest, DoNotProcessChromeIdentityCheck) {
106 // Process message only if the underlying page is an InstantNTP. 106 // Process message only if the underlying page is an InstantNTP.
107 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar")); 107 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar"));
108 EXPECT_FALSE(GetSearchIPCRouterPolicy()->ShouldProcessChromeIdentityCheck()); 108 EXPECT_FALSE(GetSearchIPCRouterPolicy()->ShouldProcessChromeIdentityCheck());
109 } 109 }
110 110
111 TEST_F(SearchIPCRouterPolicyTest, ProcessHistorySyncCheck) {
112 NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl));
113 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldProcessHistorySyncCheck());
114 }
115
116 TEST_F(SearchIPCRouterPolicyTest, DoNotProcessHistorySyncCheck) {
117 // Process message only if the underlying page is an InstantNTP.
118 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar"));
119 EXPECT_FALSE(GetSearchIPCRouterPolicy()->ShouldProcessHistorySyncCheck());
120 }
121
111 TEST_F(SearchIPCRouterPolicyTest, ProcessNavigateToURL) { 122 TEST_F(SearchIPCRouterPolicyTest, ProcessNavigateToURL) {
112 NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl)); 123 NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl));
113 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldProcessNavigateToURL(true)); 124 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldProcessNavigateToURL(true));
114 } 125 }
115 126
116 TEST_F(SearchIPCRouterPolicyTest, DoNotProcessNavigateToURL) { 127 TEST_F(SearchIPCRouterPolicyTest, DoNotProcessNavigateToURL) {
117 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar")); 128 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar"));
118 EXPECT_FALSE(GetSearchIPCRouterPolicy()->ShouldProcessNavigateToURL(true)); 129 EXPECT_FALSE(GetSearchIPCRouterPolicy()->ShouldProcessNavigateToURL(true));
119 130
120 NavigateAndCommitActiveTab(GURL("file://foo/bar")); 131 NavigateAndCommitActiveTab(GURL("file://foo/bar"));
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 234
224 TEST_F(SearchIPCRouterPolicyTest, SubmitQuery) { 235 TEST_F(SearchIPCRouterPolicyTest, SubmitQuery) {
225 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar")); 236 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar"));
226 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldSubmitQuery()); 237 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldSubmitQuery());
227 } 238 }
228 239
229 TEST_F(SearchIPCRouterPolicyTest, SendToggleVoiceSearch) { 240 TEST_F(SearchIPCRouterPolicyTest, SendToggleVoiceSearch) {
230 NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl)); 241 NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl));
231 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldSendToggleVoiceSearch()); 242 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldSendToggleVoiceSearch());
232 } 243 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698