Chromium Code Reviews| Index: components/network_time/network_time_test_utils.cc |
| diff --git a/components/network_time/network_time_test_utils.cc b/components/network_time/network_time_test_utils.cc |
| index 441ecba0269fe22ddea5a7b034238afe10cd5145..796c15ab219537ea3dc3948728337dea39d8ca20 100644 |
| --- a/components/network_time/network_time_test_utils.cc |
| +++ b/components/network_time/network_time_test_utils.cc |
| @@ -95,7 +95,14 @@ void FieldTrialTest::SetNetworkQueriesWithVariationsService( |
| // ScopedFeatureList helper class. If this comment was useful to you |
| // please send me a postcard. |
| - field_trial_list_.reset(); // Averts a CHECK fail in constructor below. |
| + // SetNetworkQueriesWithVariationsService() is usually called during test |
| + // fixture setup (to establish a default state) and then again in certain |
| + // tests that want to set special params. FieldTrialList is meant to be a |
| + // singleton with only one instance existing at once, and the constructor |
| + // fails a CHECK if this is violated. To allow these duplicate calls to this |
| + // method, any existing FieldTrialList must be destroyed before creating a new |
| + // one. |
|
meacer
2017/06/07 17:29:20
nit: Would it make sense to mention the alternativ
|
| + field_trial_list_.reset(); |
| field_trial_list_.reset( |
| new base::FieldTrialList(base::MakeUnique<base::MockEntropyProvider>())); |