| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |