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

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

Issue 2179863003: Adding a new component, Previews. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: macro change Created 4 years, 4 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "components/previews/previews_experiments.h"
6
7 #include <map>
8 #include <string>
9
10 #include "base/metrics/field_trial.h"
11 #include "components/variations/variations_associated_data.h"
12 #include "testing/gtest/include/gtest/gtest.h"
13
14 namespace {
15
16 using PreviewsExperimentsTest = testing::Test;
17
18 } // namespace
19
20 namespace previews {
21
22 TEST_F(PreviewsExperimentsTest, TestFieldTrialOfflinePage) {
23 EXPECT_FALSE(IsIncludedInClientSidePreviewsExperimentsFieldTrial());
24 EXPECT_FALSE(IsIncludedInOfflinePagesSlowConnectionFieldTrial());
25
26 std::map<std::string, std::string> params;
27 params["show_offline_pages"] = "1";
28 ASSERT_TRUE(variations::AssociateVariationParams(
29 "DataReductionProxyClientSideExperimentsFieldTrial", "Enabled", params));
30 base::FieldTrialList field_trial_list(nullptr);
31 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial(
32 "DataReductionProxyClientSideExperimentsFieldTrial", "Enabled"));
33
34 EXPECT_TRUE(IsIncludedInClientSidePreviewsExperimentsFieldTrial());
35 EXPECT_TRUE(IsIncludedInOfflinePagesSlowConnectionFieldTrial());
36 }
37
38 } // namespace previews
OLDNEW
« components/previews/previews_experiments.cc ('K') | « components/previews/previews_experiments.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698