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

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: 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 4ce88b6805103b6fa87d6f5faed2429fc3c117e7..43c9662bdde868ddf9e86a8b16d7f9529ae8db7a 100644
--- a/ui/arc/notification/arc_notification_manager_unittest.cc
+++ b/ui/arc/notification/arc_notification_manager_unittest.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <vector>
hidehiko 2016/07/11 06:05:18 nit: <string> and <memory>, too?
Luis Héctor Chávez 2016/07/11 17:15:08 Addressed in previous change.
+
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "components/arc/test/fake_arc_bridge_instance.h"
@@ -112,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());
@@ -123,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();
@@ -165,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