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

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

Issue 2888303004: Minimize the delegate dependencies for non persistent notifications. (Closed)
Patch Set: review 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 808fdd2931306d60a08898fe47df4a72ed4925bf..d0a79e47271504f30fa8018d717f7b293ee50c3f 100644
--- a/chrome/browser/notifications/platform_notification_service_unittest.cc
+++ b/chrome/browser/notifications/platform_notification_service_unittest.cc
@@ -65,23 +65,19 @@ const int kNotificationVibrationPattern[] = { 100, 200, 300 };
class MockDesktopNotificationDelegate
: public content::DesktopNotificationDelegate {
public:
- MockDesktopNotificationDelegate()
- : displayed_(false),
- clicked_(false) {}
+ MockDesktopNotificationDelegate() : displayed_(false) {}
~MockDesktopNotificationDelegate() override {}
// content::DesktopNotificationDelegate implementation.
void NotificationDisplayed() override { displayed_ = true; }
void NotificationClosed() override {}
- void NotificationClick() override { clicked_ = true; }
+ void NotificationClick() override {}
bool displayed() const { return displayed_; }
- bool clicked() const { return clicked_; }
private:
bool displayed_;
- bool clicked_;
DISALLOW_COPY_AND_ASSIGN(MockDesktopNotificationDelegate);
};
@@ -193,12 +189,15 @@ class PlatformNotificationServiceTest : public testing::Test {
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