test_tray_action_client.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // Copyright 2017 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_TRAY_ACTION_TEST_TRAY_ACTION_CLIENT_H_
  5. #define ASH_TRAY_ACTION_TEST_TRAY_ACTION_CLIENT_H_
  6. #include <vector>
  7. #include "ash/public/mojom/tray_action.mojom.h"
  8. #include "mojo/public/cpp/bindings/pending_remote.h"
  9. #include "mojo/public/cpp/bindings/receiver.h"
  10. namespace ash {
  11. class TestTrayActionClient : public mojom::TrayActionClient {
  12. public:
  13. TestTrayActionClient();
  14. TestTrayActionClient(const TestTrayActionClient&) = delete;
  15. TestTrayActionClient& operator=(const TestTrayActionClient&) = delete;
  16. ~TestTrayActionClient() override;
  17. mojo::PendingRemote<mojom::TrayActionClient> CreateRemoteAndBind();
  18. void ClearRecordedRequests();
  19. const std::vector<mojom::LockScreenNoteOrigin>& note_origins() const {
  20. return note_origins_;
  21. }
  22. const std::vector<mojom::CloseLockScreenNoteReason>& close_note_reasons()
  23. const {
  24. return close_note_reasons_;
  25. }
  26. // mojom::TrayActionClient:
  27. void RequestNewLockScreenNote(mojom::LockScreenNoteOrigin origin) override;
  28. void CloseLockScreenNote(mojom::CloseLockScreenNoteReason reason) override;
  29. private:
  30. mojo::Receiver<mojom::TrayActionClient> receiver_{this};
  31. std::vector<mojom::LockScreenNoteOrigin> note_origins_;
  32. std::vector<mojom::CloseLockScreenNoteReason> close_note_reasons_;
  33. };
  34. } // namespace ash
  35. #endif // ASH_TRAY_ACTION_TEST_TRAY_ACTION_CLIENT_H_