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

Side by Side Diff: components/search/search_unittest.cc

Issue 2520993004: Cleanup: Remove for_search param from search::InstantExtendedEnabledParam() (Closed)
Patch Set: comment Created 4 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
« no previous file with comments | « components/search/search.cc ('k') | components/search_engines/search_terms_data.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/search/search.h" 5 #include "components/search/search.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 EXPECT_TRUE(IsInstantExtendedAPIEnabled()); 158 EXPECT_TRUE(IsInstantExtendedAPIEnabled());
159 EXPECT_EQ("ion=1&", ForceInstantResultsParam(true)); 159 EXPECT_EQ("ion=1&", ForceInstantResultsParam(true));
160 EXPECT_EQ(std::string(), ForceInstantResultsParam(false)); 160 EXPECT_EQ(std::string(), ForceInstantResultsParam(false));
161 } 161 }
162 162
163 typedef EmbeddedSearchFieldTrialTest InstantExtendedEnabledParamTest; 163 typedef EmbeddedSearchFieldTrialTest InstantExtendedEnabledParamTest;
164 164
165 TEST_F(InstantExtendedEnabledParamTest, QueryExtractionDisabled) { 165 TEST_F(InstantExtendedEnabledParamTest, QueryExtractionDisabled) {
166 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial("EmbeddedSearch", 166 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial("EmbeddedSearch",
167 "Group1 espv:12")); 167 "Group1 espv:12"));
168 // Make sure InstantExtendedEnabledParam() returns an empty string for search 168 EXPECT_EQ("espv=12&", InstantExtendedEnabledParam());
169 // requests.
170 EXPECT_EQ("", InstantExtendedEnabledParam(true));
171 EXPECT_EQ("espv=12&", InstantExtendedEnabledParam(false));
172 } 169 }
173 170
174 TEST_F(InstantExtendedEnabledParamTest, UseDefaultEmbeddedSearchPageVersion) { 171 TEST_F(InstantExtendedEnabledParamTest, UseDefaultEmbeddedSearchPageVersion) {
175 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( 172 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial(
176 "EmbeddedSearch", "Group1 espv:-1")); 173 "EmbeddedSearch", "Group1 espv:-1"));
177 EXPECT_EQ("", InstantExtendedEnabledParam(true)); 174 EXPECT_EQ("espv=2&", InstantExtendedEnabledParam());
178 EXPECT_EQ("espv=2&", InstantExtendedEnabledParam(false));
179 } 175 }
180 176
181 #endif // !defined(OS_IOS) && !defined(OS_ANDROID) 177 #endif // !defined(OS_IOS) && !defined(OS_ANDROID)
182 178
183 } // namespace search 179 } // namespace search
OLDNEW
« no previous file with comments | « components/search/search.cc ('k') | components/search_engines/search_terms_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698