OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <deque> | 5 #include <deque> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
921 true); // by_user | 921 true); // by_user |
922 | 922 |
923 ASSERT_EQ(0, GetNotificationCount()); | 923 ASSERT_EQ(0, GetNotificationCount()); |
924 | 924 |
925 // Calling WebContents::IsCrashed() will return FALSE here, even if the WC did | 925 // Calling WebContents::IsCrashed() will return FALSE here, even if the WC did |
926 // crash. Work around this timing issue by creating another notification, | 926 // crash. Work around this timing issue by creating another notification, |
927 // which requires interaction with the renderer process. | 927 // which requires interaction with the renderer process. |
928 result = CreateNotification(browser(), true, "", "Title1", "Body1", "chat"); | 928 result = CreateNotification(browser(), true, "", "Title1", "Body1", "chat"); |
929 EXPECT_NE("-1", result); | 929 EXPECT_NE("-1", result); |
930 } | 930 } |
931 | |
932 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.
| |
933 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | |
934 | |
935 // Creates a simple notification. | |
936 AllowAllOrigins(); | |
937 ui_test_utils::NavigateToURL(browser(), GetTestPageURL()); | |
938 | |
939 std::string result = CreateSimpleNotification(browser(), true); | |
940 GURL base_url = embedded_test_server()->base_url(); | |
941 std::string expected_display_origin = base::StringPrintf( | |
942 "%s:%s", base_url.host().c_str(), base_url.port().c_str()); | |
943 EXPECT_EQ(base::UTF8ToUTF16(expected_display_origin), | |
944 (*notifications.rbegin())->context_message()); | |
945 } | |
OLD | NEW |