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

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

Issue 1320173002: Ship Notifications requireInteraction by default (chromium side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@requireinteraction1b
Patch Set: Always set title in browsertest Created 5 years, 3 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 | « no previous file | chrome/browser/notifications/platform_notification_service_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/platform_notification_service_browsertest.cc
diff --git a/chrome/browser/notifications/platform_notification_service_browsertest.cc b/chrome/browser/notifications/platform_notification_service_browsertest.cc
index b90dec69f9830a3e9b01a21a9c1e65d13cf4ab10..c7b6c898917ee2b7b8c20d27fa3f58dac9d59ae6 100644
--- a/chrome/browser/notifications/platform_notification_service_browsertest.cc
+++ b/chrome/browser/notifications/platform_notification_service_browsertest.cc
@@ -217,23 +217,44 @@ IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest,
WebNotificationOptionsReflection) {
ASSERT_NO_FATAL_FAILURE(GrantNotificationPermissionForTest());
+ // First, test the default values.
+
std::string script_result;
- ASSERT_TRUE(RunScript("DisplayPersistentAllOptionsNotification()",
+ ASSERT_TRUE(RunScript("DisplayPersistentNotification('Some title', {})",
&script_result));
EXPECT_EQ("ok", script_result);
ASSERT_EQ(1u, ui_manager()->GetNotificationCount());
// We don't use or check the notification's direction and language.
- const Notification& notification = ui_manager()->GetNotificationAt(0);
- EXPECT_EQ("Title", base::UTF16ToUTF8(notification.title()));
- EXPECT_EQ("Contents", base::UTF16ToUTF8(notification.message()));
- EXPECT_EQ("replace-id", notification.tag());
- EXPECT_FALSE(notification.icon().IsEmpty());
- EXPECT_TRUE(notification.silent());
+ const Notification& default_notification = ui_manager()->GetNotificationAt(0);
+ EXPECT_EQ("Some title", base::UTF16ToUTF8(default_notification.title()));
+ EXPECT_EQ("", base::UTF16ToUTF8(default_notification.message()));
+ EXPECT_EQ("", default_notification.tag());
+ EXPECT_TRUE(default_notification.icon().IsEmpty());
+ EXPECT_FALSE(default_notification.silent());
+ EXPECT_FALSE(default_notification.never_timeout());
- EXPECT_EQ(kIconWidth, notification.icon().Width());
- EXPECT_EQ(kIconHeight, notification.icon().Height());
+ // Now, test the non-default values.
+
+ ASSERT_TRUE(RunScript("DisplayPersistentAllOptionsNotification()",
+ &script_result));
+ EXPECT_EQ("ok", script_result);
+
+ ASSERT_EQ(2u, ui_manager()->GetNotificationCount());
+
+ // We don't use or check the notification's direction and language.
+ const Notification& all_options_notification =
+ ui_manager()->GetNotificationAt(1);
+ EXPECT_EQ("Title", base::UTF16ToUTF8(all_options_notification.title()));
+ EXPECT_EQ("Contents", base::UTF16ToUTF8(all_options_notification.message()));
+ EXPECT_EQ("replace-id", all_options_notification.tag());
+ EXPECT_FALSE(all_options_notification.icon().IsEmpty());
+ EXPECT_TRUE(all_options_notification.silent());
+ EXPECT_TRUE(all_options_notification.never_timeout());
+
+ EXPECT_EQ(kIconWidth, all_options_notification.icon().Width());
+ EXPECT_EQ(kIconHeight, all_options_notification.icon().Height());
}
IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest,
« no previous file with comments | « no previous file | chrome/browser/notifications/platform_notification_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698