mock_component_updater_service.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. // Automatically generated by testing/gmock/scripts/generator/gmock_gen.py.
  5. // Manual edits:
  6. // - Copyright header added.
  7. // - Includes and inclusion guard added.
  8. // - Constructor and destructor added to satisfy chromium-style checker.
  9. #ifndef COMPONENTS_COMPONENT_UPDATER_MOCK_COMPONENT_UPDATER_SERVICE_H_
  10. #define COMPONENTS_COMPONENT_UPDATER_MOCK_COMPONENT_UPDATER_SERVICE_H_
  11. #include <memory>
  12. #include <string>
  13. #include <utility>
  14. #include <vector>
  15. #include "base/callback.h"
  16. #include "base/task/sequenced_task_runner.h"
  17. #include "components/component_updater/component_updater_service.h"
  18. #include "testing/gmock/include/gmock/gmock.h"
  19. namespace component_updater {
  20. class MockComponentUpdateService : public ComponentUpdateService {
  21. public:
  22. MockComponentUpdateService();
  23. ~MockComponentUpdateService() override;
  24. void MaybeThrottle(const std::string& id,
  25. base::OnceClosure callback) override {
  26. DoMaybeThrottle(id, std::move(callback));
  27. }
  28. MOCK_METHOD1(AddObserver,
  29. void(Observer* observer));
  30. MOCK_METHOD1(RemoveObserver,
  31. void(Observer* observer));
  32. MOCK_METHOD1(RegisterComponent, bool(const ComponentRegistration& component));
  33. MOCK_METHOD1(UnregisterComponent,
  34. bool(const std::string& id));
  35. MOCK_CONST_METHOD0(GetComponentIDs,
  36. std::vector<std::string>());
  37. MOCK_CONST_METHOD0(GetComponents, std::vector<ComponentInfo>());
  38. MOCK_METHOD0(GetOnDemandUpdater,
  39. OnDemandUpdater&());
  40. MOCK_METHOD2(DoMaybeThrottle,
  41. void(const std::string& id, const base::OnceClosure& callback));
  42. MOCK_METHOD0(GetSequencedTaskRunner,
  43. scoped_refptr<base::SequencedTaskRunner>());
  44. MOCK_CONST_METHOD2(GetComponentDetails,
  45. bool(const std::string& id, CrxUpdateItem* item));
  46. };
  47. } // namespace component_updater
  48. #endif // COMPONENTS_COMPONENT_UPDATER_MOCK_COMPONENT_UPDATER_SERVICE_H_