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

Unified Diff: chrome/browser/chromeos/net/tether_notification_presenter_unittest.cc

Issue 2953973002: [CrOS Tether] Remove notifications when they have been tapped. (Closed)
Patch Set: Created 3 years, 6 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 | « chrome/browser/chromeos/net/tether_notification_presenter.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/net/tether_notification_presenter_unittest.cc
diff --git a/chrome/browser/chromeos/net/tether_notification_presenter_unittest.cc b/chrome/browser/chromeos/net/tether_notification_presenter_unittest.cc
index beeeb53a214c2282d24f5bfdcb1e6cc8a98d8dba..0f4ad413537ca19d6ad3eb0244f9aad6a0d05346 100644
--- a/chrome/browser/chromeos/net/tether_notification_presenter_unittest.cc
+++ b/chrome/browser/chromeos/net/tether_notification_presenter_unittest.cc
@@ -28,10 +28,6 @@ class TestMessageCenter : public message_center::FakeMessageCenter {
~TestMessageCenter() override {}
void NotifyNotificationTapped(const std::string& notification_id) {
- // Simulate the notification being removed, since a tap on the notification
- // removes that notification.
- RemoveNotification(notification_id, true /* by_user */);
-
for (auto& observer : observer_list_) {
observer.OnNotificationClicked(notification_id);
}
@@ -39,10 +35,6 @@ class TestMessageCenter : public message_center::FakeMessageCenter {
void NotifyNotificationButtonTapped(const std::string& notification_id,
int button_index) {
- // Simulate the notification being removed, since a tap on a notification
- // button removes that notification.
- RemoveNotification(notification_id, true /* by_user */);
-
for (auto& observer : observer_list_) {
observer.OnNotificationButtonClicked(notification_id, button_index);
}
@@ -253,6 +245,9 @@ TEST_F(TetherNotificationPresenterTest,
// Tap the notification.
test_message_center_->NotifyNotificationTapped(GetActiveHostNotificationId());
VerifySettingsOpened();
+ EXPECT_FALSE(test_message_center_->FindVisibleNotificationById(
+ GetActiveHostNotificationId()));
+ EXPECT_EQ(0u, test_message_center_->GetNumNotifications());
}
TEST_F(TetherNotificationPresenterTest, TestSetupRequiredNotification) {
@@ -308,6 +303,9 @@ TEST_F(TetherNotificationPresenterTest,
test_message_center_->NotifyNotificationTapped(
GetPotentialHotspotNotificationId());
VerifySettingsOpened();
+ EXPECT_FALSE(test_message_center_->FindVisibleNotificationById(
+ GetPotentialHotspotNotificationId()));
+ EXPECT_EQ(0u, test_message_center_->GetNumNotifications());
}
TEST_F(TetherNotificationPresenterTest,
@@ -325,6 +323,9 @@ TEST_F(TetherNotificationPresenterTest,
// Tap the notification's button.
test_message_center_->NotifyNotificationButtonTapped(
GetPotentialHotspotNotificationId(), 0 /* button_index */);
+ EXPECT_FALSE(test_message_center_->FindVisibleNotificationById(
+ GetPotentialHotspotNotificationId()));
+ EXPECT_EQ(0u, test_message_center_->GetNumNotifications());
EXPECT_EQ(test_device_.GetDeviceId(),
test_network_connect_->network_id_to_connect());
@@ -365,6 +366,9 @@ TEST_F(TetherNotificationPresenterTest,
test_message_center_->NotifyNotificationTapped(
GetPotentialHotspotNotificationId());
VerifySettingsOpened();
+ EXPECT_FALSE(test_message_center_->FindVisibleNotificationById(
+ GetPotentialHotspotNotificationId()));
+ EXPECT_EQ(0u, test_message_center_->GetNumNotifications());
}
TEST_F(TetherNotificationPresenterTest,
« no previous file with comments | « chrome/browser/chromeos/net/tether_notification_presenter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698