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 <memory> | 5 #include <memory> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 | 454 |
455 // Creates a simple notification. | 455 // Creates a simple notification. |
456 std::string script_result; | 456 std::string script_result; |
457 ASSERT_TRUE(RunScript("DisplayPersistentNotification()", &script_result)); | 457 ASSERT_TRUE(RunScript("DisplayPersistentNotification()", &script_result)); |
458 | 458 |
459 const Notification& notification = ui_manager()->GetNotificationAt(0); | 459 const Notification& notification = ui_manager()->GetNotificationAt(0); |
460 | 460 |
461 EXPECT_EQ(TestPageUrl().spec(), notification.service_worker_scope().spec()); | 461 EXPECT_EQ(TestPageUrl().spec(), notification.service_worker_scope().spec()); |
462 } | 462 } |
463 | 463 |
464 // TODO(felt): This DCHECKs when bubbles are enabled, when the file_url is | |
465 // persisted. crbug.com/502057 | |
466 IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest, | 464 IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest, |
467 DISABLED_CheckFilePermissionNotGranted) { | 465 CheckFilePermissionNotGranted) { |
468 // This case should succeed because a normal page URL is used. | 466 // This case should succeed because a normal page URL is used. |
469 std::string script_result; | 467 std::string script_result; |
470 | 468 |
471 PermissionManager* permission_manager = | 469 PermissionManager* permission_manager = |
472 PermissionManager::Get(browser()->profile()); | 470 PermissionManager::Get(browser()->profile()); |
473 | 471 |
474 EXPECT_EQ(CONTENT_SETTING_ASK, | 472 EXPECT_EQ(CONTENT_SETTING_ASK, |
475 permission_manager | 473 permission_manager |
476 ->GetPermissionStatus(CONTENT_SETTINGS_TYPE_NOTIFICATIONS, | 474 ->GetPermissionStatus(CONTENT_SETTINGS_TYPE_NOTIFICATIONS, |
477 TestPageUrl(), TestPageUrl()) | 475 TestPageUrl(), TestPageUrl()) |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 RunScript("DisplayPersistentAllOptionsNotification()", &script_result)); | 787 RunScript("DisplayPersistentAllOptionsNotification()", &script_result)); |
790 EXPECT_EQ("ok", script_result); | 788 EXPECT_EQ("ok", script_result); |
791 | 789 |
792 ASSERT_EQ(1u, ui_manager()->GetNotificationCount()); | 790 ASSERT_EQ(1u, ui_manager()->GetNotificationCount()); |
793 const Notification& notification = ui_manager()->GetNotificationAt(0); | 791 const Notification& notification = ui_manager()->GetNotificationAt(0); |
794 | 792 |
795 // Since the kNotificationContentImage kill switch has disabled images, the | 793 // Since the kNotificationContentImage kill switch has disabled images, the |
796 // notification should be shown without an image. | 794 // notification should be shown without an image. |
797 EXPECT_TRUE(notification.image().IsEmpty()); | 795 EXPECT_TRUE(notification.image().IsEmpty()); |
798 } | 796 } |
OLD | NEW |