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

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

Issue 661643002: Adds a context message of the security origin for web notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 1 month 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/notification_browsertest.cc
diff --git a/chrome/browser/notifications/notification_browsertest.cc b/chrome/browser/notifications/notification_browsertest.cc
index df9beb8f0e59791a7bd9bd540b6612beea154e74..92cc7808c2938958ea9c49c1c106c9c930c55427 100644
--- a/chrome/browser/notifications/notification_browsertest.cc
+++ b/chrome/browser/notifications/notification_browsertest.cc
@@ -837,3 +837,22 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest,
ASSERT_EQ(1, GetNotificationPopupCount());
}
+
+IN_PROC_BROWSER_TEST_F(NotificationsTest, TestDisplayOriginContextMessage) {
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+
+ // Creates a simple notification.
+ AllowAllOrigins();
+ ui_test_utils::NavigateToURL(browser(), GetTestPageURL());
+
+ std::string result = CreateSimpleNotification(browser(), true);
+
+ ASSERT_EQ(1, GetNotificationCount());
+ message_center::NotificationList::Notifications notifications =
+ message_center::MessageCenter::Get()->GetVisibleNotifications();
+ GURL base_url = embedded_test_server()->base_url();
+ std::string expected_display_origin = base::StringPrintf(
+ "%s:%s", base_url.host().c_str(), base_url.port().c_str());
+ EXPECT_EQ(base::UTF8ToUTF16(expected_display_origin),
+ (*notifications.rbegin())->context_message());
+}

Powered by Google App Engine
This is Rietveld 408576698