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/subresource_filter/core/browser/subresource_filter_features
_test_support.h" | 5 #include "components/subresource_filter/core/browser/subresource_filter_features
_test_support.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 if (existing_feature_list) { | 58 if (existing_feature_list) { |
59 std::string enabled_features; | 59 std::string enabled_features; |
60 std::string disabled_features; | 60 std::string disabled_features; |
61 base::FeatureList::GetInstance()->GetFeatureOverrides(&enabled_features, | 61 base::FeatureList::GetInstance()->GetFeatureOverrides(&enabled_features, |
62 &disabled_features); | 62 &disabled_features); |
63 feature_list->InitializeFromCommandLine(enabled_features, | 63 feature_list->InitializeFromCommandLine(enabled_features, |
64 disabled_features); | 64 disabled_features); |
65 } | 65 } |
66 | 66 |
67 scoped_feature_list_.InitWithFeatureList(std::move(feature_list)); | 67 scoped_feature_list_.InitWithFeatureList(std::move(feature_list)); |
| 68 |
| 69 // Force the active ConfigurationList to be reparsed on next access so that |
| 70 // the variation parameters come into effect. |
| 71 ClearCachedActiveConfigurations(); |
68 } | 72 } |
69 | 73 |
70 ScopedSubresourceFilterFeatureToggle::~ScopedSubresourceFilterFeatureToggle() { | 74 ScopedSubresourceFilterFeatureToggle::~ScopedSubresourceFilterFeatureToggle() { |
71 variations::testing::ClearAllVariationParams(); | 75 variations::testing::ClearAllVariationParams(); |
| 76 |
| 77 // Force the active ConfigurationList to be reparsed on next access, so that |
| 78 // the overrides from this instance are no longer in effect. |
| 79 ClearCachedActiveConfigurations(); |
72 } | 80 } |
73 | 81 |
74 } // namespace testing | 82 } // namespace testing |
75 } // namespace subresource_filter | 83 } // namespace subresource_filter |
OLD | NEW |