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

Unified Diff: ash/test/ash_test_helper.cc

Issue 2642113004: chromeos: Remove OS_WIN and OS_CHROMEOS ifdefs from ash/test (Closed)
Patch Set: Created 3 years, 11 months 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 | « ash/test/ash_test_helper.h ('k') | ash/test/test_suite.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/test/ash_test_helper.cc
diff --git a/ash/test/ash_test_helper.cc b/ash/test/ash_test_helper.cc
index b28a856f25c62e9c759584de638b8cdf825bf289..2e0dd8c57c3b4c98e535236d6327757ba55ad77e 100644
--- a/ash/test/ash_test_helper.cc
+++ b/ash/test/ash_test_helper.cc
@@ -13,6 +13,7 @@
#include "ash/common/wm_shell.h"
#include "ash/shell.h"
#include "ash/shell_init_params.h"
+#include "ash/system/chromeos/screen_layout_observer.h"
#include "ash/test/ash_test_environment.h"
#include "ash/test/ash_test_views_delegate.h"
#include "ash/test/shell_test_api.h"
@@ -20,6 +21,10 @@
#include "ash/test/test_shell_delegate.h"
#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
+#include "chromeos/audio/cras_audio_handler.h"
+#include "chromeos/dbus/dbus_thread_manager.h"
+#include "device/bluetooth/bluetooth_adapter_factory.h"
+#include "device/bluetooth/dbus/bluez_dbus_manager.h"
#include "ui/aura/env.h"
#include "ui/aura/input_state_lookup.h"
#include "ui/aura/test/env_test_helper.h"
@@ -36,18 +41,6 @@
#include "ui/wm/core/cursor_manager.h"
#include "ui/wm/core/wm_state.h"
-#if defined(OS_CHROMEOS)
-#include "ash/system/chromeos/screen_layout_observer.h"
-#include "chromeos/audio/cras_audio_handler.h"
-#include "chromeos/dbus/dbus_thread_manager.h"
-#include "device/bluetooth/bluetooth_adapter_factory.h"
-#include "device/bluetooth/dbus/bluez_dbus_manager.h"
-#endif
-
-#if defined(OS_WIN)
-#include "base/win/windows_version.h"
-#endif
-
#if defined(USE_X11)
#include "ui/aura/window_tree_host_x11.h"
#endif
@@ -58,11 +51,9 @@ namespace test {
AshTestHelper::AshTestHelper(AshTestEnvironment* ash_test_environment)
: ash_test_environment_(ash_test_environment),
test_shell_delegate_(nullptr),
- test_screenshot_delegate_(nullptr) {
-#if defined(OS_CHROMEOS)
- dbus_thread_manager_initialized_ = false;
- bluez_dbus_manager_initialized_ = false;
-#endif
+ test_screenshot_delegate_(nullptr),
+ dbus_thread_manager_initialized_(false),
+ bluez_dbus_manager_initialized_(false) {
#if defined(USE_X11)
aura::test::SetUseOverrideRedirectWindowByDefault(true);
#endif
@@ -96,7 +87,6 @@ void AshTestHelper::SetUp(bool start_session,
// tests.
message_center::MessageCenter::Initialize();
-#if defined(OS_CHROMEOS)
// Create DBusThreadManager for testing.
if (!chromeos::DBusThreadManager::IsInitialized()) {
chromeos::DBusThreadManager::Initialize(
@@ -114,7 +104,7 @@ void AshTestHelper::SetUp(bool start_session,
// Create CrasAudioHandler for testing since g_browser_process is not
// created in AshTestBase tests.
chromeos::CrasAudioHandler::InitializeForTesting();
-#endif
+
ash_test_environment_->SetUp();
// Reset the global state for the cursor manager. This includes the
// last cursor visibility state, etc.
@@ -145,11 +135,9 @@ void AshTestHelper::SetUp(bool start_session,
GetTestSessionStateDelegate()->SetHasActiveUser(true);
}
-#if defined(OS_CHROMEOS)
// Tests that change the display configuration generally don't care about the
// notifications and the popup UI can interfere with things like cursors.
shell->screen_layout_observer()->set_show_notifications_for_testing(false);
-#endif
display::test::DisplayManagerTestApi(Shell::GetInstance()->display_manager())
.DisableChangeDisplayUponHostResize();
@@ -176,7 +164,6 @@ void AshTestHelper::TearDown() {
// Remove global message center state.
message_center::MessageCenter::Shutdown();
-#if defined(OS_CHROMEOS)
chromeos::CrasAudioHandler::Shutdown();
if (bluez_dbus_manager_initialized_) {
device::BluetoothAdapterFactory::Shutdown();
@@ -187,7 +174,6 @@ void AshTestHelper::TearDown() {
chromeos::DBusThreadManager::Shutdown();
dbus_thread_manager_initialized_ = false;
}
-#endif
ui::TerminateContextFactoryForTests();
@@ -222,11 +208,12 @@ aura::Window* AshTestHelper::CurrentContext() {
// static
bool AshTestHelper::SupportsMultipleDisplays() {
-#if defined(OS_WIN)
- return false;
-#else
+ // TODO(jamescook): Figure out if we want SupportsMultipleDisplays() to return
+ // false on mustash. If not, remove this function and the AshTestBase version
+ // and remove calls from all the tests. For now just leave the ifdef strings
+ // OS_CHROMEOS and OS_WIN in this comment as a reminder to clean up.
Evan Stade 2017/01/20 15:45:49 sneaky!
+ // http://crbug.com/682990
James Cook 2017/01/20 05:10:50 I didn't just rip this out because it's called in
return true;
-#endif
}
} // namespace test
« no previous file with comments | « ash/test/ash_test_helper.h ('k') | ash/test/test_suite.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698