OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "chrome/browser/notifications/notification_interactive_uitest_support.h
" | 5 #include "chrome/browser/notifications/notification_interactive_uitest_support.h
" |
6 | 6 |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
9 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 9 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
10 #include "chrome/browser/notifications/desktop_notification_profile_util.h" | 10 #include "chrome/browser/notifications/desktop_notification_profile_util.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 } | 116 } |
117 | 117 |
118 // ----------------------------------------------------------------------------- | 118 // ----------------------------------------------------------------------------- |
119 | 119 |
120 void NotificationsTest::SetUpDefaultCommandLine( | 120 void NotificationsTest::SetUpDefaultCommandLine( |
121 base::CommandLine* command_line) { | 121 base::CommandLine* command_line) { |
122 InProcessBrowserTest::SetUpDefaultCommandLine(command_line); | 122 InProcessBrowserTest::SetUpDefaultCommandLine(command_line); |
123 // Temporary change while the whole support class is changed to deal | 123 // Temporary change while the whole support class is changed to deal |
124 // with native notifications. crbug.com/714679 | 124 // with native notifications. crbug.com/714679 |
125 #if BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS) | 125 #if BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS) |
126 command_line->AppendSwitchASCII(switches::kDisableFeatures, | 126 feature_list_.InitAndDisableFeature(features::kNativeNotifications); |
127 features::kNativeNotifications.name); | |
128 #endif // BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS) | 127 #endif // BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS) |
129 } | 128 } |
130 | 129 |
131 int NotificationsTest::GetNotificationCount() { | 130 int NotificationsTest::GetNotificationCount() { |
132 return message_center::MessageCenter::Get()->NotificationCount(); | 131 return message_center::MessageCenter::Get()->NotificationCount(); |
133 } | 132 } |
134 | 133 |
135 int NotificationsTest::GetNotificationPopupCount() { | 134 int NotificationsTest::GetNotificationPopupCount() { |
136 return message_center::MessageCenter::Get()->GetPopupNotifications().size(); | 135 return message_center::MessageCenter::Get()->GetPopupNotifications().size(); |
137 } | 136 } |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 #else | 329 #else |
331 feature_list_.InitWithFeatures( | 330 feature_list_.InitWithFeatures( |
332 {features::kPreferHtmlOverPlugins}, | 331 {features::kPreferHtmlOverPlugins}, |
333 {features::kAllowFullscreenWebNotificationsFeature}); | 332 {features::kAllowFullscreenWebNotificationsFeature}); |
334 #endif // BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS) | 333 #endif // BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS) |
335 } | 334 } |
336 | 335 |
337 void NotificationsTest::DropOriginPreference(const GURL& origin) { | 336 void NotificationsTest::DropOriginPreference(const GURL& origin) { |
338 DesktopNotificationProfileUtil::ClearSetting(browser()->profile(), origin); | 337 DesktopNotificationProfileUtil::ClearSetting(browser()->profile(), origin); |
339 } | 338 } |
OLD | NEW |