Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef BASE_TEST_MOCK_ENTROPY_PROVIDER_H_ | 5 #ifndef BASE_TEST_MOCK_ENTROPY_PROVIDER_H_ |
| 6 #define BASE_TEST_MOCK_ENTROPY_PROVIDER_H_ | 6 #define BASE_TEST_MOCK_ENTROPY_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| 11 | 11 |
| 12 namespace base { | 12 namespace base { |
| 13 | 13 |
| 14 class MockEntropyProvider : public base::FieldTrial::EntropyProvider { | 14 class MockEntropyProvider : public base::FieldTrial::EntropyProvider { |
| 15 public: | 15 public: |
| 16 MockEntropyProvider(); | |
| 16 ~MockEntropyProvider() override; | 17 ~MockEntropyProvider() override; |
| 17 | 18 |
| 18 // base::FieldTrial::EntropyProvider: | 19 // base::FieldTrial::EntropyProvider: |
| 19 double GetEntropyForTrial(const std::string& trial_name, | 20 double GetEntropyForTrial(const std::string& trial_name, |
| 20 uint32_t randomization_seed) const override; | 21 uint32_t randomization_seed) const override; |
| 22 | |
| 23 void set_entropy_value(double entropy_value) { | |
|
Alexei Svitkine (slow)
2016/05/18 15:03:29
Is there any reason to reset it after constructing
jwd
2016/05/18 18:31:41
Done.
| |
| 24 entropy_value_ = entropy_value; | |
| 25 } | |
| 26 | |
| 27 private: | |
| 28 double entropy_value_; | |
| 21 }; | 29 }; |
|
Alexei Svitkine (slow)
2016/05/18 15:03:29
Nit: DISALLOW_COPY_AND_ASSIGN();
jwd
2016/05/18 18:31:41
Done.
| |
| 22 | 30 |
| 23 } // namespace base | 31 } // namespace base |
| 24 | 32 |
| 25 #endif // BASE_TEST_MOCK_ENTROPY_PROVIDER_H_ | 33 #endif // BASE_TEST_MOCK_ENTROPY_PROVIDER_H_ |
| OLD | NEW |