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

Side by Side Diff: components/previews/core/previews_experiments_unittest.cc

Issue 2870263004: Add an about:flag to enable client-side LoFi (Closed)
Patch Set: Created 3 years, 7 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/previews/core/previews_experiments.h" 5 #include "components/previews/core/previews_experiments.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/feature_list.h" 10 #include "base/feature_list.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 base::FieldTrialList::CreateFieldTrial(kClientLoFiFieldTrial, kEnabled)); 159 base::FieldTrialList::CreateFieldTrial(kClientLoFiFieldTrial, kEnabled));
160 160
161 EXPECT_TRUE(params::IsClientLoFiEnabled()); 161 EXPECT_TRUE(params::IsClientLoFiEnabled());
162 EXPECT_EQ(10, params::ClientLoFiVersion()); 162 EXPECT_EQ(10, params::ClientLoFiVersion());
163 EXPECT_EQ(net::EFFECTIVE_CONNECTION_TYPE_3G, 163 EXPECT_EQ(net::EFFECTIVE_CONNECTION_TYPE_3G,
164 params::EffectiveConnectionTypeThresholdForClientLoFi()); 164 params::EffectiveConnectionTypeThresholdForClientLoFi());
165 165
166 variations::testing::ClearAllVariationParams(); 166 variations::testing::ClearAllVariationParams();
167 } 167 }
168 168
169 // Verifies that we can enable offline previews via comand line.
170 TEST(PreviewsExperimentsTest, TestCommandLineClientLoFi) {
171 EXPECT_FALSE(params::IsClientLoFiEnabled());
172
173 std::unique_ptr<base::FeatureList> feature_list =
174 base::MakeUnique<base::FeatureList>();
175
176 // The feature is explicitly enabled on the command-line.
177 feature_list->InitializeFromCommandLine("ClientLoFi", "");
178 base::FeatureList::ClearInstanceForTesting();
179 base::FeatureList::SetInstance(std::move(feature_list));
180
181 EXPECT_TRUE(params::IsClientLoFiEnabled());
182 base::FeatureList::ClearInstanceForTesting();
183 }
184
169 } // namespace 185 } // namespace
170 186
171 } // namespace previews 187 } // namespace previews
OLDNEW
« no previous file with comments | « components/previews/core/previews_experiments.cc ('k') | components/previews/core/previews_features.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698