Alex Deymo | 272d949 | 2014-02-03 20:28:40 -0800 | [diff] [blame] | 1 | // Copyright (c) 2014 The Chromium OS 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 | |
| 5 | #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_FAKE_RANDOM_PROVIDER_H |
| 6 | #define CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_FAKE_RANDOM_PROVIDER_H |
| 7 | |
Alex Deymo | 6e97bb2 | 2014-02-05 16:46:16 -0800 | [diff] [blame] | 8 | #include "update_engine/policy_manager/fake_variable.h" |
| 9 | #include "update_engine/policy_manager/random_provider.h" |
Alex Deymo | 272d949 | 2014-02-03 20:28:40 -0800 | [diff] [blame] | 10 | |
| 11 | namespace chromeos_policy_manager { |
| 12 | |
| 13 | // Fake implementation of the RandomProvider base class. |
| 14 | class FakeRandomProvider : public RandomProvider { |
Alex Deymo | 2de23f5 | 2014-02-26 14:30:13 -0800 | [diff] [blame^] | 15 | public: |
| 16 | FakeRandomProvider() {} |
| 17 | |
Alex Deymo | 272d949 | 2014-02-03 20:28:40 -0800 | [diff] [blame] | 18 | protected: |
| 19 | virtual bool DoInit() { |
Alex Deymo | 2de23f5 | 2014-02-26 14:30:13 -0800 | [diff] [blame^] | 20 | seed_.reset(new FakeVariable<uint64_t>("random_seed", kVariableModeConst)); |
Alex Deymo | 272d949 | 2014-02-03 20:28:40 -0800 | [diff] [blame] | 21 | return true; |
| 22 | } |
| 23 | |
| 24 | private: |
| 25 | DISALLOW_COPY_AND_ASSIGN(FakeRandomProvider); |
| 26 | }; |
| 27 | |
| 28 | } // namespace chromeos_policy_manager |
| 29 | |
| 30 | #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_FAKE_RANDOM_PROVIDER_H |