| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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/test/base/chrome_test_launcher.h" | 5 #include "chrome/test/base/chrome_test_launcher.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "chrome/test/base/chrome_test_suite.h" | 8 #include "chrome/test/base/chrome_test_suite.h" |
| 9 #include "chrome/test/base/in_process_browser_test.h" |
| 10 #include "chrome/test/base/interactive_test_utils.h" |
| 9 #include "ui/base/test/ui_controls.h" | 11 #include "ui/base/test/ui_controls.h" |
| 10 | 12 |
| 11 #if defined(USE_AURA) | 13 #if defined(USE_AURA) |
| 12 #include "ui/aura/test/ui_controls_factory_aura.h" | 14 #include "ui/aura/test/ui_controls_factory_aura.h" |
| 13 #include "ui/base/test/ui_controls_aura.h" | 15 #include "ui/base/test/ui_controls_aura.h" |
| 14 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 16 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 15 #include "ui/views/test/ui_controls_factory_desktop_aurax11.h" | 17 #include "ui/views/test/ui_controls_factory_desktop_aurax11.h" |
| 16 #endif | 18 #endif |
| 17 #endif | 19 #endif |
| 18 | 20 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 public: | 74 public: |
| 73 int RunTestSuite(int argc, char** argv) override { | 75 int RunTestSuite(int argc, char** argv) override { |
| 74 return InteractiveUITestSuite(argc, argv).Run(); | 76 return InteractiveUITestSuite(argc, argv).Run(); |
| 75 } | 77 } |
| 76 }; | 78 }; |
| 77 | 79 |
| 78 int main(int argc, char** argv) { | 80 int main(int argc, char** argv) { |
| 79 #if defined(OS_WIN) | 81 #if defined(OS_WIN) |
| 80 KillAlwaysOnTopWindows(RunType::BEFORE_TEST); | 82 KillAlwaysOnTopWindows(RunType::BEFORE_TEST); |
| 81 #endif | 83 #endif |
| 84 // TODO(sky): this causes a crash in an autofill test on macosx, figure out |
| 85 // why: http://crbug.com/641969. |
| 86 #if !defined(OS_MACOSX) |
| 87 // Without this it's possible for the first browser to start up in the |
| 88 // background, generally because the last test did something that causes the |
| 89 // test to run in the background. Most interactive ui tests assume they are in |
| 90 // the foreground and fail in weird ways if they aren't (for example, clicks |
| 91 // go to the wrong place). This ensures the first browser is always in the |
| 92 // foreground. |
| 93 InProcessBrowserTest::set_global_browser_set_up_function( |
| 94 &ui_test_utils::BringBrowserWindowToFront); |
| 95 #endif |
| 82 // Run interactive_ui_tests serially, they do not support running in parallel. | 96 // Run interactive_ui_tests serially, they do not support running in parallel. |
| 83 int default_jobs = 1; | 97 int default_jobs = 1; |
| 84 InteractiveUITestSuiteRunner runner; | 98 InteractiveUITestSuiteRunner runner; |
| 85 ChromeTestLauncherDelegate delegate(&runner); | 99 ChromeTestLauncherDelegate delegate(&runner); |
| 86 const int result = LaunchChromeTests(default_jobs, &delegate, argc, argv); | 100 const int result = LaunchChromeTests(default_jobs, &delegate, argc, argv); |
| 87 #if defined(OS_WIN) | 101 #if defined(OS_WIN) |
| 88 KillAlwaysOnTopWindows(RunType::AFTER_TEST); | 102 KillAlwaysOnTopWindows(RunType::AFTER_TEST); |
| 89 #endif | 103 #endif |
| 90 return result; | 104 return result; |
| 91 } | 105 } |
| OLD | NEW |