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

Unified Diff: chrome/browser/notifications/platform_notification_service_unittest.cc

Issue 2916383004: Revert of Minimize the delegate dependencies for non persistent notifications. (Closed)
Patch Set: Created 3 years, 7 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
Index: chrome/browser/notifications/platform_notification_service_unittest.cc
diff --git a/chrome/browser/notifications/platform_notification_service_unittest.cc b/chrome/browser/notifications/platform_notification_service_unittest.cc
index d0a79e47271504f30fa8018d717f7b293ee50c3f..808fdd2931306d60a08898fe47df4a72ed4925bf 100644
--- a/chrome/browser/notifications/platform_notification_service_unittest.cc
+++ b/chrome/browser/notifications/platform_notification_service_unittest.cc
@@ -65,19 +65,23 @@
class MockDesktopNotificationDelegate
: public content::DesktopNotificationDelegate {
public:
- MockDesktopNotificationDelegate() : displayed_(false) {}
+ MockDesktopNotificationDelegate()
+ : displayed_(false),
+ clicked_(false) {}
~MockDesktopNotificationDelegate() override {}
// content::DesktopNotificationDelegate implementation.
void NotificationDisplayed() override { displayed_ = true; }
void NotificationClosed() override {}
- void NotificationClick() override {}
+ void NotificationClick() override { clicked_ = true; }
bool displayed() const { return displayed_; }
+ bool clicked() const { return clicked_; }
private:
bool displayed_;
+ bool clicked_;
DISALLOW_COPY_AND_ASSIGN(MockDesktopNotificationDelegate);
};
@@ -189,15 +193,12 @@
std::unique_ptr<std::set<std::string>> displayed_notifications_;
};
-// Native, non persistent notifications don't have delegates any more
-#if !defined(OS_MACOSX)
TEST_F(PlatformNotificationServiceTest, DisplayPageDisplayedEvent) {
auto* delegate = CreateSimplePageNotification();
EXPECT_EQ(1u, GetNotificationCount());
EXPECT_TRUE(delegate->displayed());
}
-#endif // !defined(OS_MACOSX)
TEST_F(PlatformNotificationServiceTest, DisplayPageCloseClosure) {
base::Closure close_closure;

Powered by Google App Engine
This is Rietveld 408576698