| 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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 | 397 |
| 398 notification.delegate()->SettingsClick(); | 398 notification.delegate()->SettingsClick(); |
| 399 ASSERT_EQ(1u, ui_manager()->GetNotificationCount()); | 399 ASSERT_EQ(1u, ui_manager()->GetNotificationCount()); |
| 400 web_contents = browser()->tab_strip_model()->GetActiveWebContents(); | 400 web_contents = browser()->tab_strip_model()->GetActiveWebContents(); |
| 401 ASSERT_TRUE(content::WaitForLoadStop(web_contents)); | 401 ASSERT_TRUE(content::WaitForLoadStop(web_contents)); |
| 402 | 402 |
| 403 // No engagement should be granted for clicking on the settings link. | 403 // No engagement should be granted for clicking on the settings link. |
| 404 EXPECT_DOUBLE_EQ(5.5, GetEngagementScore(origin)); | 404 EXPECT_DOUBLE_EQ(5.5, GetEngagementScore(origin)); |
| 405 | 405 |
| 406 std::string url = web_contents->GetLastCommittedURL().spec(); | 406 std::string url = web_contents->GetLastCommittedURL().spec(); |
| 407 if (base::FeatureList::IsEnabled(features::kMaterialDesignSettings)) | 407 ASSERT_EQ("chrome://settings/content/notifications", url); |
| 408 ASSERT_EQ("chrome://settings/content/notifications", url); | |
| 409 else | |
| 410 ASSERT_EQ("chrome://settings/contentExceptions#notifications", url); | |
| 411 } | 408 } |
| 412 | 409 |
| 413 IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest, | 410 IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest, |
| 414 WebNotificationOptionsVibrationPattern) { | 411 WebNotificationOptionsVibrationPattern) { |
| 415 ASSERT_NO_FATAL_FAILURE(GrantNotificationPermissionForTest()); | 412 ASSERT_NO_FATAL_FAILURE(GrantNotificationPermissionForTest()); |
| 416 | 413 |
| 417 std::string script_result; | 414 std::string script_result; |
| 418 ASSERT_TRUE(RunScript("DisplayPersistentNotificationVibrate()", | 415 ASSERT_TRUE(RunScript("DisplayPersistentNotificationVibrate()", |
| 419 &script_result)); | 416 &script_result)); |
| 420 EXPECT_EQ("ok", script_result); | 417 EXPECT_EQ("ok", script_result); |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 RunScript("DisplayPersistentAllOptionsNotification()", &script_result)); | 840 RunScript("DisplayPersistentAllOptionsNotification()", &script_result)); |
| 844 EXPECT_EQ("ok", script_result); | 841 EXPECT_EQ("ok", script_result); |
| 845 | 842 |
| 846 ASSERT_EQ(1u, ui_manager()->GetNotificationCount()); | 843 ASSERT_EQ(1u, ui_manager()->GetNotificationCount()); |
| 847 const Notification& notification = ui_manager()->GetNotificationAt(0); | 844 const Notification& notification = ui_manager()->GetNotificationAt(0); |
| 848 | 845 |
| 849 // Since the kNotificationContentImage kill switch has disabled images, the | 846 // Since the kNotificationContentImage kill switch has disabled images, the |
| 850 // notification should be shown without an image. | 847 // notification should be shown without an image. |
| 851 EXPECT_TRUE(notification.image().IsEmpty()); | 848 EXPECT_TRUE(notification.image().IsEmpty()); |
| 852 } | 849 } |
| OLD | NEW |