mock_entropy_provider.h 888 B

1234567891011121314151617181920212223242526272829303132
  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
  3. // found in the LICENSE file.
  4. #ifndef BASE_TEST_MOCK_ENTROPY_PROVIDER_H_
  5. #define BASE_TEST_MOCK_ENTROPY_PROVIDER_H_
  6. #include <stdint.h>
  7. #include "base/metrics/field_trial.h"
  8. namespace base {
  9. class MockEntropyProvider : public base::FieldTrial::EntropyProvider {
  10. public:
  11. MockEntropyProvider();
  12. explicit MockEntropyProvider(double entropy_value);
  13. ~MockEntropyProvider() override;
  14. // base::FieldTrial::EntropyProvider:
  15. double GetEntropyForTrial(const std::string& trial_name,
  16. uint32_t randomization_seed) const override;
  17. private:
  18. double entropy_value_;
  19. DISALLOW_COPY_AND_ASSIGN(MockEntropyProvider);
  20. };
  21. } // namespace base
  22. #endif // BASE_TEST_MOCK_ENTROPY_PROVIDER_H_