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 #include "components/arc/test/fake_notifications_instance.h" | 5 #include "components/arc/test/fake_notifications_instance.h" |
6 | 6 |
7 namespace arc { | 7 namespace arc { |
8 | 8 |
9 FakeNotificationsInstance::FakeNotificationsInstance() = default; | 9 FakeNotificationsInstance::FakeNotificationsInstance( |
10 FakeNotificationsInstance::~FakeNotificationsInstance() = default; | 10 mojo::InterfaceRequest<mojom::NotificationsInstance> request) |
| 11 : binding_(this, std::move(request)) {} |
| 12 |
| 13 FakeNotificationsInstance::~FakeNotificationsInstance() {} |
11 | 14 |
12 void FakeNotificationsInstance::SendNotificationEventToAndroid( | 15 void FakeNotificationsInstance::SendNotificationEventToAndroid( |
13 const mojo::String& key, | 16 const mojo::String& key, |
14 mojom::ArcNotificationEvent event) { | 17 mojom::ArcNotificationEvent event) { |
15 events_.emplace_back(key, event); | 18 events_.emplace_back(key, event); |
16 } | 19 } |
17 | 20 |
18 void FakeNotificationsInstance::Init(mojom::NotificationsHostPtr host_ptr) {} | 21 void FakeNotificationsInstance::Init(mojom::NotificationsHostPtr host_ptr) {} |
19 | 22 |
20 const std::vector<std::pair<mojo::String, mojom::ArcNotificationEvent>>& | 23 const std::vector<std::pair<mojo::String, mojom::ArcNotificationEvent>>& |
21 FakeNotificationsInstance::events() const { | 24 FakeNotificationsInstance::events() const { |
22 return events_; | 25 return events_; |
23 } | 26 } |
24 | 27 |
| 28 void FakeNotificationsInstance::WaitForIncomingMethodCall() { |
| 29 binding_.WaitForIncomingMethodCall(); |
| 30 } |
| 31 |
25 } // namespace arc | 32 } // namespace arc |
OLD | NEW |