diff options
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/base/browser_tests_main.cc | 11 | ||||
-rw-r--r-- | chrome/test/base/chrome_test_launcher.cc | 28 | ||||
-rw-r--r-- | chrome/test/base/chrome_test_launcher.h | 13 | ||||
-rw-r--r-- | chrome/test/base/interactive_ui_tests_main.cc | 41 |
4 files changed, 22 insertions, 71 deletions
diff --git a/chrome/test/base/browser_tests_main.cc b/chrome/test/base/browser_tests_main.cc deleted file mode 100644 index cb2acce..0000000 --- a/chrome/test/base/browser_tests_main.cc +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "base/sys_info.h" -#include "chrome/test/base/chrome_test_launcher.h" - -int main(int argc, char** argv) { - int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); - return LaunchChromeTests(default_jobs, argc, argv); -} diff --git a/chrome/test/base/chrome_test_launcher.cc b/chrome/test/base/chrome_test_launcher.cc index f14ace3..345f504 100644 --- a/chrome/test/base/chrome_test_launcher.cc +++ b/chrome/test/base/chrome_test_launcher.cc @@ -55,8 +55,6 @@ #include "chrome/app/chrome_breakpad_client.h" #endif -namespace { - class ChromeTestLauncherDelegate : public content::TestLauncherDelegate { public: ChromeTestLauncherDelegate() {} @@ -128,13 +126,31 @@ class ChromeTestLauncherDelegate : public content::TestLauncherDelegate { DISALLOW_COPY_AND_ASSIGN(ChromeTestLauncherDelegate); }; -} // namespace - -int LaunchChromeTests(int default_jobs, int argc, char** argv) { +int main(int argc, char** argv) { #if defined(OS_MACOSX) chrome_browser_application_mac::RegisterBrowserCrApp(); #endif +// Only allow ui_controls to be used in interactive_ui_tests, since they depend +// on focus and can't be sharded. +#if defined(INTERACTIVE_TESTS) + ui_controls::EnableUIControls(); + +#if defined(OS_CHROMEOS) + ui_controls::InstallUIControlsAura(ash::test::CreateAshUIControls()); +#elif defined(USE_AURA) + +#if defined(OS_LINUX) + ui_controls::InstallUIControlsAura( + views::test::CreateUIControlsDesktopAura()); +#else + // TODO(win_ash): when running interactive_ui_tests for Win Ash, use above. + ui_controls::InstallUIControlsAura(aura::test::CreateUIControlsAura(NULL)); +#endif +#endif + +#endif + #if defined(OS_LINUX) || defined(OS_ANDROID) // We leak this pointer intentionally. The breakpad client needs to outlive // all other code. @@ -145,5 +161,5 @@ int LaunchChromeTests(int default_jobs, int argc, char** argv) { #endif ChromeTestLauncherDelegate launcher_delegate; - return content::LaunchTests(&launcher_delegate, default_jobs, argc, argv); + return content::LaunchTests(&launcher_delegate, argc, argv); } diff --git a/chrome/test/base/chrome_test_launcher.h b/chrome/test/base/chrome_test_launcher.h deleted file mode 100644 index b9254d3..0000000 --- a/chrome/test/base/chrome_test_launcher.h +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_TEST_BASE_CHROME_TEST_LAUNCHER_H_ -#define CHROME_TEST_BASE_CHROME_TEST_LAUNCHER_H_ - -// Launches Chrome tests using |launcher_delegate|. |default_jobs| is number -// of test jobs to be run in parallel, unless overridden from the command line. -// Returns exit code. -int LaunchChromeTests(int default_jobs, int argc, char** argv); - -#endif // CHROME_TEST_BASE_CHROME_TEST_LAUNCHER_H_ diff --git a/chrome/test/base/interactive_ui_tests_main.cc b/chrome/test/base/interactive_ui_tests_main.cc deleted file mode 100644 index 8de925a..0000000 --- a/chrome/test/base/interactive_ui_tests_main.cc +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/test/base/chrome_test_launcher.h" - -#include "ui/base/test/ui_controls.h" - -#if defined(USE_AURA) -#include "ui/aura/test/ui_controls_factory_aura.h" -#include "ui/base/test/ui_controls_aura.h" -#if defined(OS_LINUX) && !defined(OS_CHROMEOS) -#include "ui/views/test/ui_controls_factory_desktop_aurax11.h" -#endif -#endif - -#if defined(OS_CHROMEOS) -#include "ash/test/ui_controls_factory_ash.h" -#endif - -int main(int argc, char** argv) { - // Only allow ui_controls to be used in interactive_ui_tests, since they - // depend on focus and can't be sharded. - ui_controls::EnableUIControls(); - -#if defined(OS_CHROMEOS) - ui_controls::InstallUIControlsAura(ash::test::CreateAshUIControls()); -#elif defined(USE_AURA) - -#if defined(OS_LINUX) - ui_controls::InstallUIControlsAura( - views::test::CreateUIControlsDesktopAura()); -#else - // TODO(win_ash): when running interactive_ui_tests for Win Ash, use above. - ui_controls::InstallUIControlsAura(aura::test::CreateUIControlsAura(NULL)); -#endif -#endif - - // Run interactive_ui_tests serially, they do not support running in parallel. - return LaunchChromeTests(1, argc, argv); -} |