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

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: Fix merge error. Created 5 years, 11 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/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());
+}

Powered by Google App Engine
This is Rietveld 408576698