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

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

Issue 2138513002: arc: Use the new InstanceHolder for unittests (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@bridge_refactor_first
Patch Set: Rebase 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 f7298c7a4e65ec403df6ef53cc911edfb963866f..866a6b54372de3920d294eb75728b6237c537e12 100644
--- a/ui/arc/notification/arc_notification_manager_unittest.cc
+++ b/ui/arc/notification/arc_notification_manager_unittest.cc
@@ -114,9 +114,7 @@ class ArcNotificationManagerTest : public testing::Test {
std::unique_ptr<MockMessageCenter> message_center_;
void SetUp() override {
- mojom::NotificationsInstancePtr arc_notifications_instance;
- arc_notifications_instance_.reset(
- new FakeNotificationsInstance(GetProxy(&arc_notifications_instance)));
+ arc_notifications_instance_.reset(new FakeNotificationsInstance());
service_.reset(new FakeArcBridgeService());
message_center_.reset(new MockMessageCenter());
@@ -125,8 +123,7 @@ class ArcNotificationManagerTest : public testing::Test {
NotificationsObserver observer;
service_->notifications()->AddObserver(&observer);
- service_->OnNotificationsInstanceReady(
- std::move(arc_notifications_instance));
+ service_->notifications()->SetInstance(arc_notifications_instance_.get());
while (!observer.IsReady())
loop_.RunUntilIdle();
@@ -167,8 +164,6 @@ TEST_F(ArcNotificationManagerTest, NotificationRemovedByChrome) {
// |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