fake_message_sender.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. // Copyright 2020 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_COMPONENTS_PHONEHUB_FAKE_MESSAGE_SENDER_H_
  5. #define ASH_COMPONENTS_PHONEHUB_FAKE_MESSAGE_SENDER_H_
  6. #include "ash/components/phonehub/message_sender.h"
  7. #include <stdint.h>
  8. #include <string>
  9. #include <vector>
  10. #include "ash/components/phonehub/proto/phonehub_api.pb.h"
  11. namespace ash {
  12. namespace phonehub {
  13. class FakeMessageSender : public MessageSender {
  14. public:
  15. FakeMessageSender();
  16. ~FakeMessageSender() override;
  17. // MessageSender:
  18. void SendCrosState(bool notification_enabled,
  19. bool camera_roll_enabled) override;
  20. void SendUpdateNotificationModeRequest(bool do_not_disturb_enabled) override;
  21. void SendUpdateBatteryModeRequest(bool battery_saver_mode_enabled) override;
  22. void SendDismissNotificationRequest(int64_t notification_id) override;
  23. void SendNotificationInlineReplyRequest(
  24. int64_t notification_id,
  25. const std::u16string& reply_text) override;
  26. void SendShowNotificationAccessSetupRequest() override;
  27. void SendRingDeviceRequest(bool device_ringing_enabled) override;
  28. void SendFetchCameraRollItemsRequest(
  29. const proto::FetchCameraRollItemsRequest& request) override;
  30. void SendFetchCameraRollItemDataRequest(
  31. const proto::FetchCameraRollItemDataRequest& request) override;
  32. void SendInitiateCameraRollItemTransferRequest(
  33. const proto::InitiateCameraRollItemTransferRequest& request) override;
  34. void SendFeatureSetupRequest(bool camera_roll, bool notifications) override;
  35. std::pair<bool, bool> GetRecentCrosState() const;
  36. bool GetRecentUpdateNotificationModeRequest() const;
  37. bool GetRecentUpdateBatteryModeRequest() const;
  38. int64_t GetRecentDismissNotificationRequest() const;
  39. const std::pair<int64_t, std::u16string>
  40. GetRecentNotificationInlineReplyRequest() const;
  41. bool GetRecentRingDeviceRequest() const;
  42. const proto::FetchCameraRollItemsRequest&
  43. GetRecentFetchCameraRollItemsRequest() const;
  44. const proto::FetchCameraRollItemDataRequest&
  45. GetRecentFetchCameraRollItemDataRequest() const;
  46. const proto::InitiateCameraRollItemTransferRequest&
  47. GetRecentInitiateCameraRollItemTransferRequest() const;
  48. std::pair<bool, bool> GetRecentFeatureSetupRequest() const;
  49. size_t GetCrosStateCallCount() const;
  50. size_t GetUpdateNotificationModeRequestCallCount() const;
  51. size_t GetUpdateBatteryModeRequestCallCount() const;
  52. size_t GetDismissNotificationRequestCallCount() const;
  53. size_t GetNotificationInlineReplyRequestCallCount() const;
  54. size_t show_notification_access_setup_request_count() const {
  55. return show_notification_access_setup_count_;
  56. }
  57. size_t GetRingDeviceRequestCallCount() const;
  58. size_t GetFetchCameraRollItemsRequestCallCount() const;
  59. size_t GetFetchCameraRollItemDataRequestCallCount() const;
  60. size_t GetInitiateCameraRollItemTransferRequestCallCount() const;
  61. size_t GetFeatureSetupRequestCallCount() const;
  62. private:
  63. std::vector<std::pair</*is_notifications_setting_enabled*/ bool,
  64. /*is_camera_roll_setting_enabled*/ bool>>
  65. cros_states_;
  66. std::vector<bool> update_notification_mode_requests_;
  67. std::vector<bool> update_battery_mode_requests_;
  68. std::vector<int64_t> dismiss_notification_requests_;
  69. std::vector<std::pair<int64_t, std::u16string>>
  70. notification_inline_reply_requests_;
  71. std::vector<bool> ring_device_requests_;
  72. std::vector<proto::FetchCameraRollItemsRequest>
  73. fetch_camera_roll_items_requests_;
  74. std::vector<proto::FetchCameraRollItemDataRequest>
  75. fetch_camera_roll_item_data_requests_;
  76. std::vector<proto::InitiateCameraRollItemTransferRequest>
  77. initiate_camera_roll_item_transfer_requests_;
  78. size_t show_notification_access_setup_count_ = 0;
  79. std::vector<std::pair<bool, bool>> feature_setup_requests_;
  80. };
  81. } // namespace phonehub
  82. } // namespace ash
  83. #endif // ASH_COMPONENTS_PHONEHUB_FAKE_MESSAGE_SENDER_H_