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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 110 |
111 MessageCenterChangeObserver::MessageCenterChangeObserver() : impl_(new Impl) {} | 111 MessageCenterChangeObserver::MessageCenterChangeObserver() : impl_(new Impl) {} |
112 MessageCenterChangeObserver::~MessageCenterChangeObserver() = default; | 112 MessageCenterChangeObserver::~MessageCenterChangeObserver() = default; |
113 | 113 |
114 bool MessageCenterChangeObserver::Wait() { | 114 bool MessageCenterChangeObserver::Wait() { |
115 return impl_->Wait(); | 115 return impl_->Wait(); |
116 } | 116 } |
117 | 117 |
118 // ----------------------------------------------------------------------------- | 118 // ----------------------------------------------------------------------------- |
119 | 119 |
120 void NotificationsTest::SetUpDefaultCommandLine( | 120 void NotificationsTest::SetUp() { |
121 base::CommandLine* command_line) { | |
122 InProcessBrowserTest::SetUpDefaultCommandLine(command_line); | |
123 // Temporary change while the whole support class is changed to deal | 121 // Temporary change while the whole support class is changed to deal |
124 // with native notifications. crbug.com/714679 | 122 // with native notifications. crbug.com/714679 |
125 #if BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS) | 123 #if BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS) |
126 command_line->AppendSwitchASCII(switches::kDisableFeatures, | 124 feature_list_.InitAndDisableFeature(features::kNativeNotifications); |
127 features::kNativeNotifications.name); | |
128 #endif // BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS) | 125 #endif // BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS) |
| 126 InProcessBrowserTest::SetUp(); |
129 } | 127 } |
130 | 128 |
131 int NotificationsTest::GetNotificationCount() { | 129 int NotificationsTest::GetNotificationCount() { |
132 return message_center::MessageCenter::Get()->NotificationCount(); | 130 return message_center::MessageCenter::Get()->NotificationCount(); |
133 } | 131 } |
134 | 132 |
135 int NotificationsTest::GetNotificationPopupCount() { | 133 int NotificationsTest::GetNotificationPopupCount() { |
136 return message_center::MessageCenter::Get()->GetPopupNotifications().size(); | 134 return message_center::MessageCenter::Get()->GetPopupNotifications().size(); |
137 } | 135 } |
138 | 136 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 #else | 328 #else |
331 feature_list_.InitWithFeatures( | 329 feature_list_.InitWithFeatures( |
332 {features::kPreferHtmlOverPlugins}, | 330 {features::kPreferHtmlOverPlugins}, |
333 {features::kAllowFullscreenWebNotificationsFeature}); | 331 {features::kAllowFullscreenWebNotificationsFeature}); |
334 #endif // BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS) | 332 #endif // BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS) |
335 } | 333 } |
336 | 334 |
337 void NotificationsTest::DropOriginPreference(const GURL& origin) { | 335 void NotificationsTest::DropOriginPreference(const GURL& origin) { |
338 DesktopNotificationProfileUtil::ClearSetting(browser()->profile(), origin); | 336 DesktopNotificationProfileUtil::ClearSetting(browser()->profile(), origin); |
339 } | 337 } |
OLD | NEW |