| 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 feature_list_.InitAndDisableFeature(features::kNativeNotifications); | 124 feature_list_.InitAndDisableFeature(features::kNativeNotifications); |
| 127 #endif // BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS) | 125 #endif // BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS) |
| 126 InProcessBrowserTest::SetUp(); |
| 128 } | 127 } |
| 129 | 128 |
| 130 int NotificationsTest::GetNotificationCount() { | 129 int NotificationsTest::GetNotificationCount() { |
| 131 return message_center::MessageCenter::Get()->NotificationCount(); | 130 return message_center::MessageCenter::Get()->NotificationCount(); |
| 132 } | 131 } |
| 133 | 132 |
| 134 int NotificationsTest::GetNotificationPopupCount() { | 133 int NotificationsTest::GetNotificationPopupCount() { |
| 135 return message_center::MessageCenter::Get()->GetPopupNotifications().size(); | 134 return message_center::MessageCenter::Get()->GetPopupNotifications().size(); |
| 136 } | 135 } |
| 137 | 136 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 #else | 339 #else |
| 341 scoped_feature_list->InitWithFeatures( | 340 scoped_feature_list->InitWithFeatures( |
| 342 {features::kPreferHtmlOverPlugins}, | 341 {features::kPreferHtmlOverPlugins}, |
| 343 {features::kAllowFullscreenWebNotificationsFeature}); | 342 {features::kAllowFullscreenWebNotificationsFeature}); |
| 344 #endif // BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS) | 343 #endif // BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS) |
| 345 } | 344 } |
| 346 | 345 |
| 347 void NotificationsTest::DropOriginPreference(const GURL& origin) { | 346 void NotificationsTest::DropOriginPreference(const GURL& origin) { |
| 348 DesktopNotificationProfileUtil::ClearSetting(browser()->profile(), origin); | 347 DesktopNotificationProfileUtil::ClearSetting(browser()->profile(), origin); |
| 349 } | 348 } |
| OLD | NEW |