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.
5 // Automatically generated by testing/gmock/scripts/generator/gmock_gen.py.
7 // - Copyright header added.
8 // - Includes and inclusion guard added.
9 // - Constructor and destructor added to satisfy chromium-style checker.
11 #ifndef COMPONENTS_COMPONENT_UPDATER_MOCK_COMPONENT_UPDATER_SERVICE_H_
12 #define COMPONENTS_COMPONENT_UPDATER_MOCK_COMPONENT_UPDATER_SERVICE_H_
19 #include "base/functional/callback.h"
20 #include "base/task/sequenced_task_runner.h"
21 #include "base/version.h"
22 #include "components/component_updater/component_installer.h"
23 #include "components/component_updater/component_updater_service.h"
24 #include "testing/gmock/include/gmock/gmock.h"
26 namespace component_updater {
28 class MockComponentUpdateService : public ComponentUpdateService {
30 MockComponentUpdateService();
31 ~MockComponentUpdateService() override;
33 void MaybeThrottle(const std::string& id,
34 base::OnceClosure callback) override {
35 DoMaybeThrottle(id, std::move(callback));
38 base::Version GetRegisteredVersion(const std::string& app_id) override {
39 return base::Version(kNullVersion);
42 MOCK_METHOD1(AddObserver,
43 void(Observer* observer));
44 MOCK_METHOD1(RemoveObserver,
45 void(Observer* observer));
46 MOCK_METHOD1(RegisterComponent, bool(const ComponentRegistration& component));
47 MOCK_METHOD1(UnregisterComponent,
48 bool(const std::string& id));
49 MOCK_CONST_METHOD0(GetComponentIDs,
50 std::vector<std::string>());
51 MOCK_CONST_METHOD0(GetComponents, std::vector<ComponentInfo>());
52 MOCK_METHOD0(GetOnDemandUpdater,
54 MOCK_METHOD2(DoMaybeThrottle,
55 void(const std::string& id, const base::OnceClosure& callback));
56 MOCK_METHOD0(GetSequencedTaskRunner,
57 scoped_refptr<base::SequencedTaskRunner>());
58 MOCK_CONST_METHOD2(GetComponentDetails,
59 bool(const std::string& id, CrxUpdateItem* item));
62 } // namespace component_updater
64 #endif // COMPONENTS_COMPONENT_UPDATER_MOCK_COMPONENT_UPDATER_SERVICE_H_