Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Unified Diff: chrome/browser/notifications/platform_notification_service_interactive_uitest.cc

Issue 2507463003: Add kill switch for Notification images (Closed)
Patch Set: Rename test subclass Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/notifications/notification_message_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..dcb0be23e3559d2a05f979b63fa8c3c8b99b7f10 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,34 @@ IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest,
}
#endif
+class PlatformNotificationServiceWithoutContentImageBrowserTest
+ : public PlatformNotificationServiceBrowserTest {
+ public:
+ // InProcessBrowserTest overrides.
+ void SetUpInProcessBrowserTestFixture() override {
+ scoped_feature_list_.InitAndDisableFeature(
+ features::kNotificationContentImage);
+ InProcessBrowserTest::SetUpInProcessBrowserTestFixture();
+ }
+
+ private:
+ base::test::ScopedFeatureList scoped_feature_list_;
+};
+
+IN_PROC_BROWSER_TEST_F(
+ PlatformNotificationServiceWithoutContentImageBrowserTest,
+ 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 kNotificationContentImage kill switch has disabled images, the
+ // notification should be shown without an image.
+ EXPECT_TRUE(notification.image().IsEmpty());
+}
« no previous file with comments | « no previous file | content/browser/notifications/notification_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698