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()); |
+} |