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

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: bengr comments 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
« no previous file with comments | « components/previews/previews_experiments.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
(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(IsOfflinePreviewsEnabled());
25
26 std::map<std::string, std::string> params;
27 params["show_offline_pages"] = "true";
28 ASSERT_TRUE(variations::AssociateVariationParams("ClientSidePreviews",
29 "Enabled", params));
30 base::FieldTrialList field_trial_list(nullptr);
31 ASSERT_TRUE(
32 base::FieldTrialList::CreateFieldTrial("ClientSidePreviews", "Enabled"));
33
34 EXPECT_TRUE(IsIncludedInClientSidePreviewsExperimentsFieldTrial());
35 EXPECT_TRUE(IsOfflinePreviewsEnabled());
36 }
37
38 } // namespace previews
OLDNEW
« no previous file with comments | « components/previews/previews_experiments.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698