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

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

Issue 2571763003: Reduce FakeArcBridgeService usage. (Closed)
Patch Set: Created 4 years 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_arc_bridge_service.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 e77ddd0711d8eb7220d1803845a7745806e61ac1..38cb3a74459a8a9519597f1df413cdf56798c799 100644
--- a/ui/arc/notification/arc_notification_manager_unittest.cc
+++ b/ui/arc/notification/arc_notification_manager_unittest.cc
@@ -80,7 +80,6 @@ class ArcNotificationManagerTest : public testing::Test {
~ArcNotificationManagerTest() override { base::RunLoop().RunUntilIdle(); }
protected:
- FakeArcBridgeService* service() { return service_.get(); }
FakeNotificationsInstance* arc_notifications_instance() {
return arc_notifications_instance_.get();
}
@@ -109,18 +108,18 @@ class ArcNotificationManagerTest : public testing::Test {
private:
base::MessageLoop loop_;
- std::unique_ptr<FakeArcBridgeService> service_;
+ std::unique_ptr<ArcBridgeService> service_;
std::unique_ptr<FakeNotificationsInstance> arc_notifications_instance_;
std::unique_ptr<ArcNotificationManager> arc_notification_manager_;
std::unique_ptr<MockMessageCenter> message_center_;
void SetUp() override {
- arc_notifications_instance_.reset(new FakeNotificationsInstance());
- service_.reset(new FakeArcBridgeService());
- message_center_.reset(new MockMessageCenter());
+ arc_notifications_instance_ = base::MakeUnique<FakeNotificationsInstance>();
+ service_ = base::MakeUnique<ArcBridgeService>();
+ message_center_ = base::MakeUnique<MockMessageCenter>();
- arc_notification_manager_.reset(new ArcNotificationManager(
- service(), EmptyAccountId(), message_center_.get()));
+ arc_notification_manager_ = base::MakeUnique<ArcNotificationManager>(
+ service_.get(), EmptyAccountId(), message_center_.get());
NotificationsObserver observer;
service_->notifications()->AddObserver(&observer);
@@ -153,7 +152,6 @@ TEST_F(ArcNotificationManagerTest, NotificationCreatedAndRemoved) {
}
TEST_F(ArcNotificationManagerTest, NotificationRemovedByChrome) {
- service()->SetReady();
EXPECT_EQ(0u, message_center()->GetVisibleNotifications().size());
std::string key = CreateNotification();
EXPECT_EQ(1u, message_center()->GetVisibleNotifications().size());
@@ -172,7 +170,6 @@ TEST_F(ArcNotificationManagerTest, NotificationRemovedByChrome) {
}
TEST_F(ArcNotificationManagerTest, NotificationRemovedByConnectionClose) {
- service()->SetReady();
EXPECT_EQ(0u, message_center()->GetVisibleNotifications().size());
CreateNotificationWithKey("notification1");
CreateNotificationWithKey("notification2");
« no previous file with comments | « components/arc/test/fake_arc_bridge_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698