| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_ARC_TEST_FAKE_NOTIFICATIONS_INSTANCE_H_ | 5 #ifndef COMPONENTS_ARC_TEST_FAKE_NOTIFICATIONS_INSTANCE_H_ |
| 6 #define COMPONENTS_ARC_TEST_FAKE_NOTIFICATIONS_INSTANCE_H_ | 6 #define COMPONENTS_ARC_TEST_FAKE_NOTIFICATIONS_INSTANCE_H_ |
| 7 | 7 |
| 8 #include "components/arc/common/notifications.mojom.h" | 8 #include "components/arc/common/notifications.mojom.h" |
| 9 #include "components/arc/test/fake_arc_bridge_instance.h" | 9 #include "components/arc/test/fake_arc_bridge_instance.h" |
| 10 | 10 |
| 11 namespace arc { | 11 namespace arc { |
| 12 | 12 |
| 13 class FakeNotificationsInstance : public mojom::NotificationsInstance { | 13 class FakeNotificationsInstance : public mojom::NotificationsInstance { |
| 14 public: | 14 public: |
| 15 FakeNotificationsInstance( | 15 FakeNotificationsInstance(); |
| 16 mojo::InterfaceRequest<mojom::NotificationsInstance> request); | |
| 17 ~FakeNotificationsInstance() override; | 16 ~FakeNotificationsInstance() override; |
| 18 | 17 |
| 19 void Init(mojom::NotificationsHostPtr host_ptr) override; | 18 void Init(mojom::NotificationsHostPtr host_ptr) override; |
| 20 | 19 |
| 21 void SendNotificationEventToAndroid( | 20 void SendNotificationEventToAndroid( |
| 22 const mojo::String& key, | 21 const mojo::String& key, |
| 23 mojom::ArcNotificationEvent event) override; | 22 mojom::ArcNotificationEvent event) override; |
| 24 | 23 |
| 25 const std::vector<std::pair<mojo::String, mojom::ArcNotificationEvent>>& | 24 const std::vector<std::pair<mojo::String, mojom::ArcNotificationEvent>>& |
| 26 events() const; | 25 events() const; |
| 27 | 26 |
| 28 void WaitForIncomingMethodCall(); | |
| 29 | |
| 30 private: | 27 private: |
| 31 std::vector<std::pair<mojo::String, mojom::ArcNotificationEvent>> events_; | 28 std::vector<std::pair<mojo::String, mojom::ArcNotificationEvent>> events_; |
| 32 | 29 |
| 33 mojo::Binding<mojom::NotificationsInstance> binding_; | |
| 34 | |
| 35 DISALLOW_COPY_AND_ASSIGN(FakeNotificationsInstance); | 30 DISALLOW_COPY_AND_ASSIGN(FakeNotificationsInstance); |
| 36 }; | 31 }; |
| 37 | 32 |
| 38 } // namespace arc | 33 } // namespace arc |
| 39 | 34 |
| 40 #endif // COMPONENTS_ARC_TEST_FAKE_NOTIFICATIONS_INSTANCE_H_ | 35 #endif // COMPONENTS_ARC_TEST_FAKE_NOTIFICATIONS_INSTANCE_H_ |
| OLD | NEW |