Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: components/arc/test/fake_notifications_instance.h

Issue 2144013002: Reland of arc: Use the new InstanceHolder for unittests (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@bridge_refactor_first
Patch Set: Fixed bad merge Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
11 #include "components/arc/common/notifications.mojom.h" 11 #include "components/arc/common/notifications.mojom.h"
12 #include "components/arc/test/fake_arc_bridge_instance.h" 12 #include "components/arc/test/fake_arc_bridge_instance.h"
13 13
14 namespace arc { 14 namespace arc {
15 15
16 class FakeNotificationsInstance : public mojom::NotificationsInstance { 16 class FakeNotificationsInstance : public mojom::NotificationsInstance {
17 public: 17 public:
18 FakeNotificationsInstance( 18 FakeNotificationsInstance();
19 mojo::InterfaceRequest<mojom::NotificationsInstance> request);
20 ~FakeNotificationsInstance() override; 19 ~FakeNotificationsInstance() override;
21 20
22 void Init(mojom::NotificationsHostPtr host_ptr) override; 21 void Init(mojom::NotificationsHostPtr host_ptr) override;
23 22
24 void SendNotificationEventToAndroid( 23 void SendNotificationEventToAndroid(
25 const mojo::String& key, 24 const mojo::String& key,
26 mojom::ArcNotificationEvent event) override; 25 mojom::ArcNotificationEvent event) override;
27 26
28 const std::vector<std::pair<mojo::String, mojom::ArcNotificationEvent>>& 27 const std::vector<std::pair<mojo::String, mojom::ArcNotificationEvent>>&
29 events() const; 28 events() const;
30 29
31 void WaitForIncomingMethodCall();
32
33 private: 30 private:
34 std::vector<std::pair<mojo::String, mojom::ArcNotificationEvent>> events_; 31 std::vector<std::pair<mojo::String, mojom::ArcNotificationEvent>> events_;
35 32
36 mojo::Binding<mojom::NotificationsInstance> binding_;
37
38 DISALLOW_COPY_AND_ASSIGN(FakeNotificationsInstance); 33 DISALLOW_COPY_AND_ASSIGN(FakeNotificationsInstance);
39 }; 34 };
40 35
41 } // namespace arc 36 } // namespace arc
42 37
43 #endif // COMPONENTS_ARC_TEST_FAKE_NOTIFICATIONS_INSTANCE_H_ 38 #endif // COMPONENTS_ARC_TEST_FAKE_NOTIFICATIONS_INSTANCE_H_
OLDNEW
« no previous file with comments | « components/arc/test/fake_app_instance.cc ('k') | components/arc/test/fake_notifications_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698