robpercival | 3de5340 | 2016-01-12 16:29:02 | [diff] [blame] | 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 | |
| 5 | // Automatically generated by testing/gmock/scripts/generator/gmock_gen.py. |
| 6 | // Manual edits: |
| 7 | // - Copyright header added. |
| 8 | // - Includes and inclusion guard added. |
| 9 | // - Constructor and destructor added to satisfy chromium-style checker. |
| 10 | |
| 11 | #ifndef COMPONENTS_COMPONENT_UPDATER_MOCK_COMPONENT_UPDATER_SERVICE_H_ |
| 12 | #define COMPONENTS_COMPONENT_UPDATER_MOCK_COMPONENT_UPDATER_SERVICE_H_ |
| 13 | |
Joshua Pawlicki | 0499ac8 | 2017-08-17 18:29:07 | [diff] [blame] | 14 | #include <memory> |
waffles | 77255cc | 2016-08-02 17:25:12 | [diff] [blame] | 15 | #include <string> |
Sorin Jianu | a8ef73d | 2017-11-02 16:55:17 | [diff] [blame] | 16 | #include <utility> |
waffles | 77255cc | 2016-08-02 17:25:12 | [diff] [blame] | 17 | #include <vector> |
| 18 | |
robpercival | 3de5340 | 2016-01-12 16:29:02 | [diff] [blame] | 19 | #include "base/callback.h" |
| 20 | #include "base/sequenced_task_runner.h" |
| 21 | #include "components/component_updater/component_updater_service.h" |
| 22 | #include "testing/gmock/include/gmock/gmock.h" |
| 23 | |
| 24 | namespace component_updater { |
| 25 | |
| 26 | class MockComponentUpdateService : public ComponentUpdateService { |
| 27 | public: |
| 28 | MockComponentUpdateService(); |
| 29 | ~MockComponentUpdateService() override; |
| 30 | |
Daniel Cheng | 6784852 | 2018-04-27 22:04:41 | [diff] [blame] | 31 | void MaybeThrottle(const std::string& id, |
| 32 | base::OnceClosure callback) override { |
Sorin Jianu | a8ef73d | 2017-11-02 16:55:17 | [diff] [blame] | 33 | DoMaybeThrottle(id, std::move(callback)); |
| 34 | } |
| 35 | |
robpercival | 3de5340 | 2016-01-12 16:29:02 | [diff] [blame] | 36 | MOCK_METHOD1(AddObserver, |
| 37 | void(Observer* observer)); |
| 38 | MOCK_METHOD1(RemoveObserver, |
| 39 | void(Observer* observer)); |
| 40 | MOCK_METHOD1(RegisterComponent, |
| 41 | bool(const CrxComponent& component)); |
| 42 | MOCK_METHOD1(UnregisterComponent, |
| 43 | bool(const std::string& id)); |
| 44 | MOCK_CONST_METHOD0(GetComponentIDs, |
| 45 | std::vector<std::string>()); |
waffles | 77255cc | 2016-08-02 17:25:12 | [diff] [blame] | 46 | MOCK_CONST_METHOD1( |
| 47 | GetComponentForMimeType, |
| 48 | std::unique_ptr<ComponentInfo>(const std::string& mime_type)); |
Joshua Pawlicki | 0499ac8 | 2017-08-17 18:29:07 | [diff] [blame] | 49 | MOCK_CONST_METHOD0(GetComponents, std::vector<ComponentInfo>()); |
robpercival | 3de5340 | 2016-01-12 16:29:02 | [diff] [blame] | 50 | MOCK_METHOD0(GetOnDemandUpdater, |
| 51 | OnDemandUpdater&()); |
Sorin Jianu | a8ef73d | 2017-11-02 16:55:17 | [diff] [blame] | 52 | MOCK_METHOD2(DoMaybeThrottle, |
| 53 | void(const std::string& id, const base::OnceClosure& callback)); |
robpercival | 3de5340 | 2016-01-12 16:29:02 | [diff] [blame] | 54 | MOCK_METHOD0(GetSequencedTaskRunner, |
| 55 | scoped_refptr<base::SequencedTaskRunner>()); |
| 56 | MOCK_CONST_METHOD2(GetComponentDetails, |
| 57 | bool(const std::string& id, CrxUpdateItem* item)); |
| 58 | }; |
| 59 | |
| 60 | } // namespace component_updater |
| 61 | |
| 62 | #endif // COMPONENTS_COMPONENT_UPDATER_MOCK_COMPONENT_UPDATER_SERVICE_H_ |