| 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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 | 406 |
| 407 notification.delegate()->SettingsClick(); | 407 notification.delegate()->SettingsClick(); |
| 408 ASSERT_EQ(1u, ui_manager()->GetNotificationCount()); | 408 ASSERT_EQ(1u, ui_manager()->GetNotificationCount()); |
| 409 web_contents = browser()->tab_strip_model()->GetActiveWebContents(); | 409 web_contents = browser()->tab_strip_model()->GetActiveWebContents(); |
| 410 ASSERT_TRUE(content::WaitForLoadStop(web_contents)); | 410 ASSERT_TRUE(content::WaitForLoadStop(web_contents)); |
| 411 | 411 |
| 412 // No engagement should be granted for clicking on the settings link. | 412 // No engagement should be granted for clicking on the settings link. |
| 413 EXPECT_DOUBLE_EQ(5.5, GetEngagementScore(origin)); | 413 EXPECT_DOUBLE_EQ(5.5, GetEngagementScore(origin)); |
| 414 | 414 |
| 415 std::string url = web_contents->GetLastCommittedURL().spec(); | 415 std::string url = web_contents->GetLastCommittedURL().spec(); |
| 416 if (base::FeatureList::IsEnabled(features::kMaterialDesignSettings)) | 416 ASSERT_EQ("chrome://settings/content/notifications", url); |
| 417 ASSERT_EQ("chrome://settings/content/notifications", url); | |
| 418 else | |
| 419 ASSERT_EQ("chrome://settings/contentExceptions#notifications", url); | |
| 420 } | 417 } |
| 421 | 418 |
| 422 IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest, | 419 IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest, |
| 423 WebNotificationOptionsVibrationPattern) { | 420 WebNotificationOptionsVibrationPattern) { |
| 424 ASSERT_NO_FATAL_FAILURE(GrantNotificationPermissionForTest()); | 421 ASSERT_NO_FATAL_FAILURE(GrantNotificationPermissionForTest()); |
| 425 | 422 |
| 426 std::string script_result; | 423 std::string script_result; |
| 427 ASSERT_TRUE(RunScript("DisplayPersistentNotificationVibrate()", | 424 ASSERT_TRUE(RunScript("DisplayPersistentNotificationVibrate()", |
| 428 &script_result)); | 425 &script_result)); |
| 429 EXPECT_EQ("ok", script_result); | 426 EXPECT_EQ("ok", script_result); |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 RunScript("DisplayPersistentAllOptionsNotification()", &script_result)); | 855 RunScript("DisplayPersistentAllOptionsNotification()", &script_result)); |
| 859 EXPECT_EQ("ok", script_result); | 856 EXPECT_EQ("ok", script_result); |
| 860 | 857 |
| 861 ASSERT_EQ(1u, ui_manager()->GetNotificationCount()); | 858 ASSERT_EQ(1u, ui_manager()->GetNotificationCount()); |
| 862 const Notification& notification = ui_manager()->GetNotificationAt(0); | 859 const Notification& notification = ui_manager()->GetNotificationAt(0); |
| 863 | 860 |
| 864 // Since the kNotificationContentImage kill switch has disabled images, the | 861 // Since the kNotificationContentImage kill switch has disabled images, the |
| 865 // notification should be shown without an image. | 862 // notification should be shown without an image. |
| 866 EXPECT_TRUE(notification.image().IsEmpty()); | 863 EXPECT_TRUE(notification.image().IsEmpty()); |
| 867 } | 864 } |
| OLD | NEW |