Index: chrome/browser/notifications/notification_browsertest.cc |
diff --git a/chrome/browser/notifications/notification_browsertest.cc b/chrome/browser/notifications/notification_browsertest.cc |
index 36262e5449f9ec1a2e4ab138826af39766f8ebba..028d943150f855dbcc48a43af060c3d1e6347ca4 100644 |
--- a/chrome/browser/notifications/notification_browsertest.cc |
+++ b/chrome/browser/notifications/notification_browsertest.cc |
@@ -928,3 +928,18 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestNotificationDoubleClose) { |
result = CreateNotification(browser(), true, "", "Title1", "Body1", "chat"); |
EXPECT_NE("-1", result); |
} |
+ |
+IN_PROC_BROWSER_TEST_F(NotificationsTest, TestDisplayOriginContextMessage) { |
Peter Beverloo
2015/01/10 00:03:33
This should probably go in PlatformNotificationBro
dewittj
2015/01/13 22:18:01
Done.
|
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
+ |
+ // Creates a simple notification. |
+ AllowAllOrigins(); |
+ ui_test_utils::NavigateToURL(browser(), GetTestPageURL()); |
+ |
+ std::string result = CreateSimpleNotification(browser(), true); |
+ 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()); |
+} |