| OLD | NEW |
| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 EXPECT_EQ(2, params::PerHostBlackListOptOutThreshold()); | 67 EXPECT_EQ(2, params::PerHostBlackListOptOutThreshold()); |
| 68 EXPECT_EQ(4, params::HostIndifferentBlackListOptOutThreshold()); | 68 EXPECT_EQ(4, params::HostIndifferentBlackListOptOutThreshold()); |
| 69 EXPECT_EQ(base::TimeDelta::FromDays(30), params::PerHostBlackListDuration()); | 69 EXPECT_EQ(base::TimeDelta::FromDays(30), params::PerHostBlackListDuration()); |
| 70 EXPECT_EQ(base::TimeDelta::FromDays(365 * 100), | 70 EXPECT_EQ(base::TimeDelta::FromDays(365 * 100), |
| 71 params::HostIndifferentBlackListPerHostDuration()); | 71 params::HostIndifferentBlackListPerHostDuration()); |
| 72 EXPECT_EQ(base::TimeDelta::FromSeconds(60 * 5), | 72 EXPECT_EQ(base::TimeDelta::FromSeconds(60 * 5), |
| 73 params::SingleOptOutDuration()); | 73 params::SingleOptOutDuration()); |
| 74 EXPECT_EQ(base::TimeDelta::FromDays(7), | 74 EXPECT_EQ(base::TimeDelta::FromDays(7), |
| 75 params::OfflinePreviewFreshnessDuration()); | 75 params::OfflinePreviewFreshnessDuration()); |
| 76 EXPECT_EQ(net::EFFECTIVE_CONNECTION_TYPE_SLOW_2G, | 76 EXPECT_EQ(net::EFFECTIVE_CONNECTION_TYPE_SLOW_2G, |
| 77 params::EffectiveConnectionTypeThresholdForOffline()); | 77 params::DefaultEffectiveConnectionTypeThreshold()); |
| 78 EXPECT_EQ(0, params::OfflinePreviewsVersion()); | 78 EXPECT_EQ(0, params::OfflinePreviewsVersion()); |
| 79 | 79 |
| 80 base::FieldTrialList field_trial_list(nullptr); | 80 base::FieldTrialList field_trial_list(nullptr); |
| 81 | 81 |
| 82 // Set some custom params. Somewhat random yet valid values. | 82 // Set some custom params. Somewhat random yet valid values. |
| 83 std::map<std::string, std::string> custom_params = { | 83 std::map<std::string, std::string> custom_params = { |
| 84 {"per_host_max_stored_history_length", "3"}, | 84 {"per_host_max_stored_history_length", "3"}, |
| 85 {"host_indifferent_max_stored_history_length", "4"}, | 85 {"host_indifferent_max_stored_history_length", "4"}, |
| 86 {"max_hosts_in_blacklist", "13"}, | 86 {"max_hosts_in_blacklist", "13"}, |
| 87 {"per_host_opt_out_threshold", "12"}, | 87 {"per_host_opt_out_threshold", "12"}, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 103 EXPECT_EQ(13u, params::MaxInMemoryHostsInBlackList()); | 103 EXPECT_EQ(13u, params::MaxInMemoryHostsInBlackList()); |
| 104 EXPECT_EQ(12, params::PerHostBlackListOptOutThreshold()); | 104 EXPECT_EQ(12, params::PerHostBlackListOptOutThreshold()); |
| 105 EXPECT_EQ(84, params::HostIndifferentBlackListOptOutThreshold()); | 105 EXPECT_EQ(84, params::HostIndifferentBlackListOptOutThreshold()); |
| 106 EXPECT_EQ(base::TimeDelta::FromDays(99), params::PerHostBlackListDuration()); | 106 EXPECT_EQ(base::TimeDelta::FromDays(99), params::PerHostBlackListDuration()); |
| 107 EXPECT_EQ(base::TimeDelta::FromDays(64), | 107 EXPECT_EQ(base::TimeDelta::FromDays(64), |
| 108 params::HostIndifferentBlackListPerHostDuration()); | 108 params::HostIndifferentBlackListPerHostDuration()); |
| 109 EXPECT_EQ(base::TimeDelta::FromSeconds(28), params::SingleOptOutDuration()); | 109 EXPECT_EQ(base::TimeDelta::FromSeconds(28), params::SingleOptOutDuration()); |
| 110 EXPECT_EQ(base::TimeDelta::FromDays(12), | 110 EXPECT_EQ(base::TimeDelta::FromDays(12), |
| 111 params::OfflinePreviewFreshnessDuration()); | 111 params::OfflinePreviewFreshnessDuration()); |
| 112 EXPECT_EQ(net::EFFECTIVE_CONNECTION_TYPE_4G, | 112 EXPECT_EQ(net::EFFECTIVE_CONNECTION_TYPE_4G, |
| 113 params::EffectiveConnectionTypeThresholdForOffline()); | 113 params::DefaultEffectiveConnectionTypeThreshold()); |
| 114 EXPECT_EQ(10, params::OfflinePreviewsVersion()); | 114 EXPECT_EQ(10, params::OfflinePreviewsVersion()); |
| 115 | 115 |
| 116 variations::testing::ClearAllVariationParams(); | 116 variations::testing::ClearAllVariationParams(); |
| 117 } | 117 } |
| 118 | 118 |
| 119 TEST(PreviewsExperimentsTest, TestClientLoFiDisabledByDefault) { | 119 TEST(PreviewsExperimentsTest, TestClientLoFiDisabledByDefault) { |
| 120 base::FieldTrialList field_trial_list(nullptr); | 120 base::FieldTrialList field_trial_list(nullptr); |
| 121 EXPECT_FALSE(params::IsClientLoFiEnabled()); | 121 EXPECT_FALSE(params::IsClientLoFiEnabled()); |
| 122 } | 122 } |
| 123 | 123 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } // namespace | 169 } // namespace |
| 170 | 170 |
| 171 } // namespace previews | 171 } // namespace previews |
| OLD | NEW |