mock_ui_broker.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Copyright 2021 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. #ifndef ASH_QUICK_PAIR_UI_MOCK_UI_BROKER_H_
  5. #define ASH_QUICK_PAIR_UI_MOCK_UI_BROKER_H_
  6. #include "ash/quick_pair/ui/actions.h"
  7. #include "ash/quick_pair/ui/ui_broker.h"
  8. #include "base/observer_list.h"
  9. #include "testing/gmock/include/gmock/gmock.h"
  10. namespace ash {
  11. namespace quick_pair {
  12. struct Device;
  13. class MockUIBroker : public UIBroker {
  14. public:
  15. MockUIBroker();
  16. MockUIBroker(const MockUIBroker&) = delete;
  17. MockUIBroker& operator=(const MockUIBroker&) = delete;
  18. ~MockUIBroker() override;
  19. MOCK_METHOD(void, ShowDiscovery, (scoped_refptr<Device>), (override));
  20. MOCK_METHOD(void, ShowPairing, (scoped_refptr<Device>), (override));
  21. MOCK_METHOD(void, ShowPairingFailed, (scoped_refptr<Device>), (override));
  22. MOCK_METHOD(void, ShowAssociateAccount, (scoped_refptr<Device>), (override));
  23. MOCK_METHOD(void, ShowCompanionApp, (scoped_refptr<Device>), (override));
  24. MOCK_METHOD(void, RemoveNotifications, (), (override));
  25. void AddObserver(Observer* observer) override;
  26. void RemoveObserver(Observer* observer) override;
  27. void NotifyDiscoveryAction(scoped_refptr<Device> device,
  28. DiscoveryAction action);
  29. void NotifyCompanionAppAction(scoped_refptr<Device> device,
  30. CompanionAppAction action);
  31. void NotifyPairingFailedAction(scoped_refptr<Device> device,
  32. PairingFailedAction action);
  33. void NotifyAssociateAccountAction(scoped_refptr<Device> device,
  34. AssociateAccountAction action);
  35. private:
  36. base::ObserverList<Observer> observers_;
  37. };
  38. } // namespace quick_pair
  39. } // namespace ash
  40. #endif // ASH_QUICK_PAIR_UI_MOCK_UI_BROKER_H_