Chromium Code Reviews| Index: chrome/browser/notifications/platform_notification_service_interactive_uitest.cc |
| diff --git a/chrome/browser/notifications/platform_notification_service_interactive_uitest.cc b/chrome/browser/notifications/platform_notification_service_interactive_uitest.cc |
| index f88f16f6eca074644fc0dbb07eac31c768d0ce49..bb870e021f4ad9e93db4078287e4ea611809659a 100644 |
| --- a/chrome/browser/notifications/platform_notification_service_interactive_uitest.cc |
| +++ b/chrome/browser/notifications/platform_notification_service_interactive_uitest.cc |
| @@ -29,6 +29,7 @@ |
| #include "chrome/test/base/interactive_test_utils.h" |
| #include "chrome/test/base/ui_test_utils.h" |
| #include "content/public/browser/permission_type.h" |
| +#include "content/public/common/content_features.h" |
| #include "content/public/common/content_switches.h" |
| #include "content/public/test/browser_test_utils.h" |
| #include "net/base/filename_util.h" |
| @@ -703,3 +704,32 @@ IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest, |
| } |
| #endif |
| +class PlatformNotificationServiceBrowserTestWithoutImages |
|
Peter Beverloo
2016/11/15 19:39:20
"WithoutImages" implies a much broader scope than
johnme
2016/11/16 00:33:11
Done (ContentImage).
|
| + : public PlatformNotificationServiceBrowserTest { |
| + public: |
| + // InProcessBrowserTest overrides. |
| + void SetUpInProcessBrowserTestFixture() override { |
| + scoped_feature_list_.InitAndDisableFeature(features::kNotificationImage); |
| + InProcessBrowserTest::SetUpInProcessBrowserTestFixture(); |
| + } |
| + |
| + private: |
| + base::test::ScopedFeatureList scoped_feature_list_; |
| +}; |
| + |
| +IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTestWithoutImages, |
| + KillSwitch) { |
| + ASSERT_NO_FATAL_FAILURE(GrantNotificationPermissionForTest()); |
| + |
| + std::string script_result; |
| + ASSERT_TRUE( |
| + RunScript("DisplayPersistentAllOptionsNotification()", &script_result)); |
| + EXPECT_EQ("ok", script_result); |
| + |
| + ASSERT_EQ(1u, ui_manager()->GetNotificationCount()); |
| + const Notification& notification = ui_manager()->GetNotificationAt(0); |
| + |
| + // Since the kNotificationImage kill switch has disabled images, the |
| + // notification should be shown without an image. |
| + EXPECT_TRUE(notification.image().IsEmpty()); |
| +} |