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

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

Issue 1026853002: Integrate the notification database with the normal code path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-db-ConfirmShow
Patch Set: Created 5 years, 8 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 2bd06aae249565bb910708c4b3bfe572f88d79a6..40a8eec1f28bd88a040c72e566404bb9522caf33 100644
--- a/chrome/browser/notifications/platform_notification_service_unittest.cc
+++ b/chrome/browser/notifications/platform_notification_service_unittest.cc
@@ -17,6 +17,10 @@
namespace {
+#if !defined(OS_ANDROID)
+const int64_t kPersistentNotificationId = 42;
+#endif
+
class MockDesktopNotificationDelegate
: public content::DesktopNotificationDelegate {
public:
@@ -126,13 +130,16 @@ TEST_F(PlatformNotificationServiceTest, DisplayPageCloseClosure) {
// delegate given that it'd result in a use-after-free.
}
+// TODO(peter): Re-enable this test when //content is responsible for creating
+// the notification delegate ids.
+#if !defined(OS_ANDROID)
TEST_F(PlatformNotificationServiceTest, PersistentNotificationDisplay) {
content::PlatformNotificationData notification_data;
notification_data.title = base::ASCIIToUTF16("My notification's title");
notification_data.body = base::ASCIIToUTF16("Hello, world!");
service()->DisplayPersistentNotification(
- profile(), 42 /* sw_registration_id */, GURL("https://chrome.com/"),
+ profile(), kPersistentNotificationId, GURL("https://chrome.com/"),
SkBitmap(), notification_data);
ASSERT_EQ(1u, ui_manager()->GetNotificationCount());
@@ -144,10 +151,10 @@ TEST_F(PlatformNotificationServiceTest, PersistentNotificationDisplay) {
EXPECT_EQ("Hello, world!",
base::UTF16ToUTF8(notification.message()));
- service()->ClosePersistentNotification(profile(),
- notification.delegate_id());
+ service()->ClosePersistentNotification(profile(), kPersistentNotificationId);
EXPECT_EQ(0u, ui_manager()->GetNotificationCount());
}
+#endif // !defined(OS_ANDROID)
TEST_F(PlatformNotificationServiceTest, DisplayPageNotificationMatches) {
content::PlatformNotificationData notification_data;

Powered by Google App Engine
This is Rietveld 408576698