OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 RequestAndAcceptPermission(); | 280 RequestAndAcceptPermission(); |
281 | 281 |
282 // Creates a simple notification. | 282 // Creates a simple notification. |
283 std::string script_result; | 283 std::string script_result; |
284 ASSERT_TRUE(RunScript("DisplayPersistentNotification()", &script_result)); | 284 ASSERT_TRUE(RunScript("DisplayPersistentNotification()", &script_result)); |
285 | 285 |
286 net::HostPortPair host_port = ServerHostPort(); | 286 net::HostPortPair host_port = ServerHostPort(); |
287 | 287 |
288 const Notification& notification = ui_manager()->GetNotificationAt(0); | 288 const Notification& notification = ui_manager()->GetNotificationAt(0); |
289 | 289 |
290 EXPECT_EQ(base::UTF8ToUTF16(host_port.ToString()), | 290 EXPECT_TRUE(notification.context_message().empty()); |
291 notification.context_message()); | 291 EXPECT_EQ("https://" + host_port.ToString() + "/", |
| 292 notification.origin_url().spec()); |
292 } | 293 } |
293 | 294 |
294 IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest, | 295 IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest, |
295 CheckFilePermissionNotGranted) { | 296 CheckFilePermissionNotGranted) { |
296 // TODO(felt): This DCHECKs when bubbles are enabled, when the file_url is | 297 // TODO(felt): This DCHECKs when bubbles are enabled, when the file_url is |
297 // persisted. crbug.com/502057 | 298 // persisted. crbug.com/502057 |
298 if (PermissionBubbleManager::Enabled()) | 299 if (PermissionBubbleManager::Enabled()) |
299 return; | 300 return; |
300 | 301 |
301 // TODO(dewittj): It currently isn't possible to get the notification | 302 // TODO(dewittj): It currently isn't possible to get the notification |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 | 372 |
372 ASSERT_EQ(1u, ui_manager()->GetNotificationCount()); | 373 ASSERT_EQ(1u, ui_manager()->GetNotificationCount()); |
373 | 374 |
374 const Notification& notification = ui_manager()->GetNotificationAt(0); | 375 const Notification& notification = ui_manager()->GetNotificationAt(0); |
375 EXPECT_FALSE(notification.icon().IsEmpty()); | 376 EXPECT_FALSE(notification.icon().IsEmpty()); |
376 | 377 |
377 EXPECT_EQ("Blob Title", base::UTF16ToUTF8(notification.title())); | 378 EXPECT_EQ("Blob Title", base::UTF16ToUTF8(notification.title())); |
378 EXPECT_EQ(kIconWidth, notification.icon().Width()); | 379 EXPECT_EQ(kIconWidth, notification.icon().Width()); |
379 EXPECT_EQ(kIconHeight, notification.icon().Height()); | 380 EXPECT_EQ(kIconHeight, notification.icon().Height()); |
380 } | 381 } |
OLD | NEW |