Chromium Code Reviews| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 | 109 |
| 110 MessageCenterChangeObserver::MessageCenterChangeObserver() : impl_(new Impl) {} | 110 MessageCenterChangeObserver::MessageCenterChangeObserver() : impl_(new Impl) {} |
| 111 MessageCenterChangeObserver::~MessageCenterChangeObserver() = default; | 111 MessageCenterChangeObserver::~MessageCenterChangeObserver() = default; |
| 112 | 112 |
| 113 bool MessageCenterChangeObserver::Wait() { | 113 bool MessageCenterChangeObserver::Wait() { |
| 114 return impl_->Wait(); | 114 return impl_->Wait(); |
| 115 } | 115 } |
| 116 | 116 |
| 117 // ----------------------------------------------------------------------------- | 117 // ----------------------------------------------------------------------------- |
| 118 | 118 |
| 119 void NotificationsTest::SetUpDefaultCommandLine( | |
|
Peter Beverloo
2017/04/24 16:11:16
I think it's more common to override SetUpCommandL
Miguel Garcia
2017/04/24 17:26:04
Acknowledged.
| |
| 120 base::CommandLine* command_line) { | |
| 121 InProcessBrowserTest::SetUpDefaultCommandLine(command_line); | |
| 122 // Temporary change while the whole support class is changed to deal | |
| 123 // with native notifications. | |
|
Peter Beverloo
2017/04/24 16:11:16
nit: refer to a bug
Miguel Garcia
2017/04/24 17:26:04
Done.
| |
| 124 #if defined(OS_MACOSX) | |
| 125 command_line->AppendSwitchASCII("disable-features", "NativeNotifications"); | |
|
Peter Beverloo
2017/04/24 16:11:16
#include "chrome/common/chrome_features.h"
#includ
Miguel Garcia
2017/04/24 17:26:04
Done.
| |
| 126 #endif | |
| 127 } | |
| 128 | |
| 119 int NotificationsTest::GetNotificationCount() { | 129 int NotificationsTest::GetNotificationCount() { |
| 120 return message_center::MessageCenter::Get()->NotificationCount(); | 130 return message_center::MessageCenter::Get()->NotificationCount(); |
| 121 } | 131 } |
| 122 | 132 |
| 123 int NotificationsTest::GetNotificationPopupCount() { | 133 int NotificationsTest::GetNotificationPopupCount() { |
| 124 return message_center::MessageCenter::Get()->GetPopupNotifications().size(); | 134 return message_center::MessageCenter::Get()->GetPopupNotifications().size(); |
| 125 } | 135 } |
| 126 | 136 |
| 127 void NotificationsTest::CloseBrowserWindow(Browser* browser) { | 137 void NotificationsTest::CloseBrowserWindow(Browser* browser) { |
| 128 content::WindowedNotificationObserver observer( | 138 content::WindowedNotificationObserver observer( |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 290 | 300 |
| 291 void NotificationsTest::DisableFullscreenNotifications() { | 301 void NotificationsTest::DisableFullscreenNotifications() { |
| 292 feature_list_.InitWithFeatures( | 302 feature_list_.InitWithFeatures( |
| 293 {features::kPreferHtmlOverPlugins}, | 303 {features::kPreferHtmlOverPlugins}, |
| 294 {features::kAllowFullscreenWebNotificationsFeature}); | 304 {features::kAllowFullscreenWebNotificationsFeature}); |
| 295 } | 305 } |
| 296 | 306 |
| 297 void NotificationsTest::DropOriginPreference(const GURL& origin) { | 307 void NotificationsTest::DropOriginPreference(const GURL& origin) { |
| 298 DesktopNotificationProfileUtil::ClearSetting(browser()->profile(), origin); | 308 DesktopNotificationProfileUtil::ClearSetting(browser()->profile(), origin); |
| 299 } | 309 } |
| OLD | NEW |