| OLD | NEW |
| (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 |
| OLD | NEW |