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

Unified Diff: ui/arc/notification/arc_notification_manager_unittest.cc

Issue 2146573005: Revert of arc: Use the new InstanceHolder for unittests (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@bridge_refactor_first
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/arc/test/fake_notifications_instance.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/arc/notification/arc_notification_manager_unittest.cc
diff --git a/ui/arc/notification/arc_notification_manager_unittest.cc b/ui/arc/notification/arc_notification_manager_unittest.cc
index 866a6b54372de3920d294eb75728b6237c537e12..f7298c7a4e65ec403df6ef53cc911edfb963866f 100644
--- a/ui/arc/notification/arc_notification_manager_unittest.cc
+++ b/ui/arc/notification/arc_notification_manager_unittest.cc
@@ -114,7 +114,9 @@
std::unique_ptr<MockMessageCenter> message_center_;
void SetUp() override {
- arc_notifications_instance_.reset(new FakeNotificationsInstance());
+ mojom::NotificationsInstancePtr arc_notifications_instance;
+ arc_notifications_instance_.reset(
+ new FakeNotificationsInstance(GetProxy(&arc_notifications_instance)));
service_.reset(new FakeArcBridgeService());
message_center_.reset(new MockMessageCenter());
@@ -123,7 +125,8 @@
NotificationsObserver observer;
service_->notifications()->AddObserver(&observer);
- service_->notifications()->SetInstance(arc_notifications_instance_.get());
+ service_->OnNotificationsInstanceReady(
+ std::move(arc_notifications_instance));
while (!observer.IsReady())
loop_.RunUntilIdle();
@@ -164,6 +167,8 @@
// |notification| gets stale here.
}
+ arc_notifications_instance()->WaitForIncomingMethodCall();
+
ASSERT_EQ(1u, arc_notifications_instance()->events().size());
EXPECT_EQ(key, arc_notifications_instance()->events().at(0).first);
EXPECT_EQ(mojom::ArcNotificationEvent::CLOSED,
« no previous file with comments | « components/arc/test/fake_notifications_instance.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698