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

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

Issue 2133503002: arc: Revamp the ArcBridgeService interface (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: More rebasing 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 | « ui/arc/notification/arc_notification_manager.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 eadbb842b9a0596211c253d2f72f9dd35e6b71f6..f7298c7a4e65ec403df6ef53cc911edfb963866f 100644
--- a/ui/arc/notification/arc_notification_manager_unittest.cc
+++ b/ui/arc/notification/arc_notification_manager_unittest.cc
@@ -2,8 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <memory>
+#include <string>
+#include <vector>
+
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
+#include "components/arc/instance_holder.h"
#include "components/arc/test/fake_arc_bridge_instance.h"
#include "components/arc/test/fake_arc_bridge_service.h"
#include "components/arc/test/fake_notifications_instance.h"
@@ -52,17 +57,18 @@ class MockMessageCenter : public message_center::FakeMessageCenter {
DISALLOW_COPY_AND_ASSIGN(MockMessageCenter);
};
-class ArcBridgeServiceObserver : public ArcBridgeService::Observer {
+class NotificationsObserver
+ : public InstanceHolder<mojom::NotificationsInstance>::Observer {
public:
- ArcBridgeServiceObserver() = default;
- void OnNotificationsInstanceReady() override { ready_ = true; }
+ NotificationsObserver() = default;
+ void OnInstanceReady() override { ready_ = true; }
bool IsReady() { return ready_; }
private:
bool ready_ = false;
- DISALLOW_COPY_AND_ASSIGN(ArcBridgeServiceObserver);
+ DISALLOW_COPY_AND_ASSIGN(NotificationsObserver);
};
} // anonymous namespace
@@ -117,15 +123,15 @@ class ArcNotificationManagerTest : public testing::Test {
arc_notification_manager_.reset(new ArcNotificationManager(
service(), EmptyAccountId(), message_center_.get()));
- ArcBridgeServiceObserver observer;
- service_->AddObserver(&observer);
+ NotificationsObserver observer;
+ service_->notifications()->AddObserver(&observer);
service_->OnNotificationsInstanceReady(
std::move(arc_notifications_instance));
while (!observer.IsReady())
loop_.RunUntilIdle();
- service_->RemoveObserver(&observer);
+ service_->notifications()->RemoveObserver(&observer);
}
void TearDown() override {
@@ -177,7 +183,7 @@ TEST_F(ArcNotificationManagerTest, NotificationRemovedByConnectionClose) {
CreateNotificationWithKey("notification3");
EXPECT_EQ(3u, message_center()->GetVisibleNotifications().size());
- arc_notification_manager()->OnNotificationsInstanceClosed();
+ arc_notification_manager()->OnInstanceClosed();
EXPECT_EQ(0u, message_center()->GetVisibleNotifications().size());
}
« no previous file with comments | « ui/arc/notification/arc_notification_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698