1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/test/base/chrome_test_launcher.h"
7 #include "chrome/test/base/chrome_test_suite.h"
8 #include "ui/base/test/ui_controls.h"
11 #include "ui/aura/test/ui_controls_factory_aura.h"
12 #include "ui/base/test/ui_controls_aura.h"
13 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
14 #include "ui/views/test/ui_controls_factory_desktop_aurax11.h"
18 #if defined(OS_CHROMEOS)
19 #include "ash/test/ui_controls_factory_ash.h"
23 #include "base/win/scoped_com_initializer.h"
26 class InteractiveUITestSuite
: public ChromeTestSuite
{
28 InteractiveUITestSuite(int argc
, char** argv
) : ChromeTestSuite(argc
, argv
) {}
29 ~InteractiveUITestSuite() override
{}
32 // ChromeTestSuite overrides:
33 void Initialize() override
{
34 ChromeTestSuite::Initialize();
36 // Only allow ui_controls to be used in interactive_ui_tests, since they
37 // depend on focus and can't be sharded.
38 ui_controls::EnableUIControls();
40 #if defined(OS_CHROMEOS)
41 ui_controls::InstallUIControlsAura(ash::test::CreateAshUIControls());
42 #elif defined(USE_AURA)
44 com_initializer_
.reset(new base::win::ScopedCOMInitializer());
48 ui_controls::InstallUIControlsAura(
49 views::test::CreateUIControlsDesktopAura());
51 // TODO(win_ash): when running interactive_ui_tests for Win Ash, use above.
52 ui_controls::InstallUIControlsAura(aura::test::CreateUIControlsAura(NULL
));
57 void Shutdown() override
{
59 com_initializer_
.reset();
65 scoped_ptr
<base::win::ScopedCOMInitializer
> com_initializer_
;
69 class InteractiveUITestSuiteRunner
: public ChromeTestSuiteRunner
{
71 int RunTestSuite(int argc
, char** argv
) override
{
72 return InteractiveUITestSuite(argc
, argv
).Run();
76 int main(int argc
, char** argv
) {
77 // Run interactive_ui_tests serially, they do not support running in parallel.
79 InteractiveUITestSuiteRunner runner
;
80 return LaunchChromeTests(default_jobs
, &runner
, argc
, argv
);