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

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

Issue 2166363003: Offline pages using NQE 2G Slow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: thestig 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
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/previews_experiments.h" 5 #include "components/previews/previews_experiments.h"
6 6
7 #include <map>
8 #include <string>
9
10 #include "base/metrics/field_trial.h" 7 #include "base/metrics/field_trial.h"
11 #include "components/variations/variations_associated_data.h"
12 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
13 9
14 namespace { 10 namespace {
15 11
16 using PreviewsExperimentsTest = testing::Test; 12 using PreviewsExperimentsTest = testing::Test;
17 13
18 } // namespace 14 } // namespace
19 15
20 namespace previews { 16 namespace previews {
21 17
22 TEST_F(PreviewsExperimentsTest, TestFieldTrialOfflinePage) { 18 TEST_F(PreviewsExperimentsTest, TestFieldTrialOfflinePage) {
23 EXPECT_FALSE(IsIncludedInClientSidePreviewsExperimentsFieldTrial()); 19 EXPECT_FALSE(IsIncludedInClientSidePreviewsExperimentsFieldTrial());
24 EXPECT_FALSE(IsOfflinePreviewsEnabled()); 20 EXPECT_FALSE(IsOfflinePreviewsEnabled());
25 21
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); 22 base::FieldTrialList field_trial_list(nullptr);
31 ASSERT_TRUE( 23 ASSERT_TRUE(EnableOfflinePreviewsForTesting());
32 base::FieldTrialList::CreateFieldTrial("ClientSidePreviews", "Enabled"));
33 24
34 EXPECT_TRUE(IsIncludedInClientSidePreviewsExperimentsFieldTrial()); 25 EXPECT_TRUE(IsIncludedInClientSidePreviewsExperimentsFieldTrial());
35 EXPECT_TRUE(IsOfflinePreviewsEnabled()); 26 EXPECT_TRUE(IsOfflinePreviewsEnabled());
36 } 27 }
37 28
38 } // namespace previews 29 } // 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