1 // Copyright 2015 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef BASE_TEST_MOCK_ENTROPY_PROVIDER_H_ 6 #define BASE_TEST_MOCK_ENTROPY_PROVIDER_H_ 7 8 #include <stdint.h> 9 10 #include <string_view> 11 12 #include "base/metrics/field_trial.h" 13 14 namespace base { 15 16 class MockEntropyProvider : public base::FieldTrial::EntropyProvider { 17 public: 18 MockEntropyProvider(); 19 explicit MockEntropyProvider(double entropy_value); 20 21 MockEntropyProvider(const MockEntropyProvider&) = delete; 22 MockEntropyProvider& operator=(const MockEntropyProvider&) = delete; 23 24 ~MockEntropyProvider() override; 25 26 // base::FieldTrial::EntropyProvider: 27 double GetEntropyForTrial(std::string_view trial_name, 28 uint32_t randomization_seed) const override; 29 30 private: 31 double entropy_value_; 32 }; 33 34 } // namespace base 35 36 #endif // BASE_TEST_MOCK_ENTROPY_PROVIDER_H_ 37