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 
14 #include <memory>
15 #include <string>
16 #include <utility>
17 #include <vector>
18 
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 
MaybeThrottle(const std::string & id,base::OnceClosure callback)31   void MaybeThrottle(const std::string& id,
32                      base::OnceClosure callback) override {
33     DoMaybeThrottle(id, std::move(callback));
34   }
35 
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>());
46   MOCK_CONST_METHOD1(
47       GetComponentForMimeType,
48       std::unique_ptr<ComponentInfo>(const std::string& mime_type));
49   MOCK_CONST_METHOD0(GetComponents, std::vector<ComponentInfo>());
50   MOCK_METHOD0(GetOnDemandUpdater,
51       OnDemandUpdater&());
52   MOCK_METHOD2(DoMaybeThrottle,
53                void(const std::string& id, const base::OnceClosure& callback));
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_
63