1 // Copyright 2016 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 #ifndef COMPONENTS_ARC_TEST_FAKE_NOTIFICATIONS_INSTANCE_H_
6 #define COMPONENTS_ARC_TEST_FAKE_NOTIFICATIONS_INSTANCE_H_
7 
8 #include <string>
9 #include <utility>
10 #include <vector>
11 
12 #include "components/arc/mojom/notifications.mojom.h"
13 #include "mojo/public/cpp/bindings/pending_remote.h"
14 
15 namespace arc {
16 
17 class FakeNotificationsInstance : public mojom::NotificationsInstance {
18  public:
19   FakeNotificationsInstance();
20   ~FakeNotificationsInstance() override;
21 
22   // mojom::NotificationsInstance overrides:
23   void InitDeprecated(
24       mojo::PendingRemote<mojom::NotificationsHost> host_remote) override;
25   void Init(mojo::PendingRemote<mojom::NotificationsHost> host_remote,
26             InitCallback callback) override;
27 
28   void SendNotificationEventToAndroid(
29       const std::string& key,
30       mojom::ArcNotificationEvent event) override;
31   void CreateNotificationWindow(const std::string& key) override;
32   void CloseNotificationWindow(const std::string& key) override;
33   void OpenNotificationSettings(const std::string& key) override;
34   void OpenNotificationSnoozeSettings(const std::string& key) override;
35   void SetDoNotDisturbStatusOnAndroid(
36       mojom::ArcDoNotDisturbStatusPtr status) override;
37   void CancelPress(const std::string& key) override;
38   void PerformDeferredUserAction(uint32_t action_id) override;
39   void CancelDeferredUserAction(uint32_t action_id) override;
40   void SetLockScreenSettingOnAndroid(
41       mojom::ArcLockScreenNotificationSettingPtr setting) override;
42   void SetNotificationConfiguration(
43       mojom::NotificationConfigurationPtr configuration) override;
44   void OnMessageCenterVisibilityChanged(
45       mojom::MessageCenterVisibility visibility) override;
46 
47   const std::vector<std::pair<std::string, mojom::ArcNotificationEvent>>&
48   events() const;
49   const mojom::ArcDoNotDisturbStatusPtr& latest_do_not_disturb_status() const;
50 
51  private:
52   std::vector<std::pair<std::string, mojom::ArcNotificationEvent>> events_;
53   mojom::ArcDoNotDisturbStatusPtr latest_do_not_disturb_status_;
54 
55   DISALLOW_COPY_AND_ASSIGN(FakeNotificationsInstance);
56 };
57 
58 }  // namespace arc
59 
60 #endif  // COMPONENTS_ARC_TEST_FAKE_NOTIFICATIONS_INSTANCE_H_
61