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

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

Issue 1154063003: removing ShouldHideTopMatch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changed deprecated var name Created 5 years, 6 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
« no previous file with comments | « components/search/search.cc ('k') | no next file » | 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 "base/metrics/field_trial.h" 7 #include "base/metrics/field_trial.h"
8 #include "base/metrics/statistics_recorder.h" 8 #include "base/metrics/statistics_recorder.h"
9 #include "components/variations/entropy_provider.h" 9 #include "components/variations/entropy_provider.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 TEST_F(EmbeddedSearchFieldTrialTest, GetFieldTrialInfoControlFlags) { 124 TEST_F(EmbeddedSearchFieldTrialTest, GetFieldTrialInfoControlFlags) {
125 FieldTrialFlags flags; 125 FieldTrialFlags flags;
126 126
127 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( 127 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial(
128 "EmbeddedSearch", "Control77 bar:1 baz:7 cat:dogs")); 128 "EmbeddedSearch", "Control77 bar:1 baz:7 cat:dogs"));
129 EXPECT_TRUE(GetFieldTrialInfo(&flags)); 129 EXPECT_TRUE(GetFieldTrialInfo(&flags));
130 EXPECT_EQ(3ul, flags.size()); 130 EXPECT_EQ(3ul, flags.size());
131 } 131 }
132 132
133 typedef EmbeddedSearchFieldTrialTest ShouldHideTopVerbatimTest;
134
135 TEST_F(ShouldHideTopVerbatimTest, DoNotHideByDefault) {
136 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial("EmbeddedSearch",
137 "Control"));
138 EXPECT_FALSE(ShouldHideTopVerbatimMatch());
139 }
140
141 TEST_F(ShouldHideTopVerbatimTest, DoNotHideInInstantExtended) {
142 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial("EmbeddedSearch",
143 "Group1"));
144 EXPECT_FALSE(ShouldHideTopVerbatimMatch());
145 }
146
147 TEST_F(ShouldHideTopVerbatimTest, EnableByFlagInInstantExtended) {
148 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial("EmbeddedSearch",
149 "Group1 hide_verbatim:1"));
150 EXPECT_TRUE(ShouldHideTopVerbatimMatch());
151 }
152
153 TEST_F(ShouldHideTopVerbatimTest, EnableByFlagOutsideInstantExtended) {
154 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial(
155 "EmbeddedSearch", "Controll1 hide_verbatim:1"));
156 EXPECT_TRUE(ShouldHideTopVerbatimMatch());
157 }
158
159 TEST_F(ShouldHideTopVerbatimTest, DisableByFlag) {
160 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial("EmbeddedSearch",
161 "Group1 hide_verbatim:0"));
162 EXPECT_FALSE(ShouldHideTopVerbatimMatch());
163 }
164
165 } // namespace chrome 133 } // namespace chrome
OLDNEW
« no previous file with comments | « components/search/search.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698