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

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

Issue 1543203002: Remove a variety of no-longer-used query params. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 4 years, 11 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 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 TEST_F(SearchIPCRouterPolicyTest, SendSetDisplayInstantResults) { 165 TEST_F(SearchIPCRouterPolicyTest, SendSetDisplayInstantResults) {
166 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar")); 166 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar"));
167 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldSendSetDisplayInstantResults()); 167 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldSendSetDisplayInstantResults());
168 } 168 }
169 169
170 TEST_F(SearchIPCRouterPolicyTest, SendSetSuggestionToPrefetch) { 170 TEST_F(SearchIPCRouterPolicyTest, SendSetSuggestionToPrefetch) {
171 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar")); 171 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar"));
172 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldSendSetSuggestionToPrefetch()); 172 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldSendSetSuggestionToPrefetch());
173 } 173 }
174 174
175 TEST_F(SearchIPCRouterPolicyTest, SendSetOmniboxStartMargin) {
176 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar"));
177 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldSendSetOmniboxStartMargin());
178 }
179
180 TEST_F(SearchIPCRouterPolicyTest, 175 TEST_F(SearchIPCRouterPolicyTest,
181 DoNotSendSetMessagesForIncognitoPage) { 176 DoNotSendSetMessagesForIncognitoPage) {
182 NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl)); 177 NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl));
183 SetIncognitoProfile(); 178 SetIncognitoProfile();
184 179
185 SearchIPCRouter::Policy* router_policy = GetSearchIPCRouterPolicy(); 180 SearchIPCRouter::Policy* router_policy = GetSearchIPCRouterPolicy();
186 EXPECT_FALSE(router_policy->ShouldSendSetSuggestionToPrefetch()); 181 EXPECT_FALSE(router_policy->ShouldSendSetSuggestionToPrefetch());
187 EXPECT_FALSE(router_policy->ShouldSendSetDisplayInstantResults()); 182 EXPECT_FALSE(router_policy->ShouldSendSetDisplayInstantResults());
188 EXPECT_FALSE(router_policy->ShouldSendSetPromoInformation()); 183 EXPECT_FALSE(router_policy->ShouldSendSetPromoInformation());
189 EXPECT_FALSE(router_policy->ShouldSendThemeBackgroundInfo()); 184 EXPECT_FALSE(router_policy->ShouldSendThemeBackgroundInfo());
190 EXPECT_FALSE(router_policy->ShouldSendMostVisitedItems()); 185 EXPECT_FALSE(router_policy->ShouldSendMostVisitedItems());
191 EXPECT_FALSE(router_policy->ShouldSendSetInputInProgress(true)); 186 EXPECT_FALSE(router_policy->ShouldSendSetInputInProgress(true));
192 EXPECT_FALSE(router_policy->ShouldSendOmniboxFocusChanged()); 187 EXPECT_FALSE(router_policy->ShouldSendOmniboxFocusChanged());
193 } 188 }
194 189
195 TEST_F(SearchIPCRouterPolicyTest, 190 TEST_F(SearchIPCRouterPolicyTest,
196 AppropriateMessagesSentToIncognitoPages) { 191 AppropriateMessagesSentToIncognitoPages) {
197 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar")); 192 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar"));
198 SetIncognitoProfile(); 193 SetIncognitoProfile();
199 194
200 SearchIPCRouter::Policy* router_policy = GetSearchIPCRouterPolicy(); 195 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldSubmitQuery());
201 EXPECT_TRUE(router_policy->ShouldSubmitQuery());
202 EXPECT_TRUE(router_policy->ShouldSendSetOmniboxStartMargin());
203 } 196 }
204 197
205 TEST_F(SearchIPCRouterPolicyTest, SendMostVisitedItems) { 198 TEST_F(SearchIPCRouterPolicyTest, SendMostVisitedItems) {
206 NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl)); 199 NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl));
207 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldSendMostVisitedItems()); 200 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldSendMostVisitedItems());
208 } 201 }
209 202
210 TEST_F(SearchIPCRouterPolicyTest, DoNotSendMostVisitedItems) { 203 TEST_F(SearchIPCRouterPolicyTest, DoNotSendMostVisitedItems) {
211 // Send most visited items only if the current tab is an Instant NTP. 204 // Send most visited items only if the current tab is an Instant NTP.
212 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar")); 205 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar"));
213 EXPECT_FALSE(GetSearchIPCRouterPolicy()->ShouldSendMostVisitedItems()); 206 EXPECT_FALSE(GetSearchIPCRouterPolicy()->ShouldSendMostVisitedItems());
214 } 207 }
215 208
216 TEST_F(SearchIPCRouterPolicyTest, SendThemeBackgroundInfo) { 209 TEST_F(SearchIPCRouterPolicyTest, SendThemeBackgroundInfo) {
217 NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl)); 210 NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl));
218 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldSendThemeBackgroundInfo()); 211 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldSendThemeBackgroundInfo());
219 } 212 }
220 213
221 TEST_F(SearchIPCRouterPolicyTest, DoNotSendThemeBackgroundInfo) { 214 TEST_F(SearchIPCRouterPolicyTest, DoNotSendThemeBackgroundInfo) {
222 // Send theme background information only if the current tab is an 215 // Send theme background information only if the current tab is an
223 // Instant NTP. 216 // Instant NTP.
224 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar")); 217 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar"));
225 EXPECT_FALSE(GetSearchIPCRouterPolicy()->ShouldSendThemeBackgroundInfo()); 218 EXPECT_FALSE(GetSearchIPCRouterPolicy()->ShouldSendThemeBackgroundInfo());
226 } 219 }
227 220
228 TEST_F(SearchIPCRouterPolicyTest, SubmitQuery) { 221 TEST_F(SearchIPCRouterPolicyTest, SubmitQuery) {
229 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar")); 222 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar"));
230 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldSubmitQuery()); 223 EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldSubmitQuery());
231 } 224 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/search/search_ipc_router_policy_impl.cc ('k') | chrome/browser/ui/search/search_ipc_router_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698