| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_TEST_UI_UI_TEST_SUITE_H_ | 5 #ifndef CHROME_TEST_UI_UI_TEST_SUITE_H_ |
| 6 #define CHROME_TEST_UI_UI_TEST_SUITE_H_ | 6 #define CHROME_TEST_UI_UI_TEST_SUITE_H_ |
| 7 | 7 |
| 8 #include "base/process.h" |
| 8 #include "chrome/test/ui/ui_test.h" | 9 #include "chrome/test/ui/ui_test.h" |
| 9 #include "chrome/test/unit/chrome_test_suite.h" | 10 #include "chrome/test/unit/chrome_test_suite.h" |
| 10 | 11 |
| 11 class UITestSuite : public ChromeTestSuite { | 12 class UITestSuite : public ChromeTestSuite { |
| 12 public: | 13 public: |
| 13 UITestSuite(int argc, char** argv) : ChromeTestSuite(argc, argv) { | 14 UITestSuite(int argc, char** argv); |
| 14 } | |
| 15 | 15 |
| 16 protected: | 16 protected: |
| 17 virtual void Initialize(); |
| 17 | 18 |
| 18 virtual void Initialize() { | 19 virtual void Shutdown(); |
| 19 ChromeTestSuite::Initialize(); | |
| 20 | 20 |
| 21 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 21 virtual void SuppressErrorDialogs(); |
| 22 UITest::set_in_process_renderer( | |
| 23 parsed_command_line.HasSwitch(switches::kSingleProcess)); | |
| 24 UITest::set_no_sandbox( | |
| 25 parsed_command_line.HasSwitch(switches::kNoSandbox)); | |
| 26 UITest::set_full_memory_dump( | |
| 27 parsed_command_line.HasSwitch(switches::kFullMemoryCrashReport)); | |
| 28 UITest::set_safe_plugins( | |
| 29 parsed_command_line.HasSwitch(switches::kSafePlugins)); | |
| 30 UITest::set_use_existing_browser( | |
| 31 parsed_command_line.HasSwitch(UITestSuite::kUseExistingBrowser)); | |
| 32 UITest::set_dump_histograms_on_exit( | |
| 33 parsed_command_line.HasSwitch(switches::kDumpHistogramsOnExit)); | |
| 34 UITest::set_enable_dcheck( | |
| 35 parsed_command_line.HasSwitch(switches::kEnableDCHECK)); | |
| 36 UITest::set_silent_dump_on_dcheck( | |
| 37 parsed_command_line.HasSwitch(switches::kSilentDumpOnDCHECK)); | |
| 38 UITest::set_disable_breakpad( | |
| 39 parsed_command_line.HasSwitch(switches::kDisableBreakpad)); | |
| 40 std::wstring test_timeout = | |
| 41 parsed_command_line.GetSwitchValue(UITestSuite::kTestTimeout); | |
| 42 if (!test_timeout.empty()) { | |
| 43 UITest::set_test_timeout_ms(StringToInt(WideToUTF16Hack(test_timeout))); | |
| 44 } | |
| 45 std::wstring js_flags = | |
| 46 parsed_command_line.GetSwitchValue(switches::kJavaScriptFlags); | |
| 47 if (!js_flags.empty()) { | |
| 48 UITest::set_js_flags(js_flags); | |
| 49 } | |
| 50 std::wstring log_level = | |
| 51 parsed_command_line.GetSwitchValue(switches::kLoggingLevel); | |
| 52 if (!log_level.empty()) { | |
| 53 UITest::set_log_level(log_level); | |
| 54 } | |
| 55 } | |
| 56 | |
| 57 virtual void SuppressErrorDialogs() { | |
| 58 #if defined(OS_WIN) | |
| 59 TestSuite::SuppressErrorDialogs(); | |
| 60 #endif | |
| 61 UITest::set_show_error_dialogs(false); | |
| 62 } | |
| 63 | 22 |
| 64 private: | 23 private: |
| 24 #if defined(OS_WIN) |
| 25 void LoadCrashService(); |
| 26 |
| 27 base::ProcessHandle crash_service_; |
| 28 #endif |
| 29 |
| 65 static const wchar_t kUseExistingBrowser[]; | 30 static const wchar_t kUseExistingBrowser[]; |
| 66 static const wchar_t kTestTimeout[]; | 31 static const wchar_t kTestTimeout[]; |
| 67 }; | 32 }; |
| 68 | 33 |
| 69 #endif // CHROME_TEST_UI_UI_TEST_SUITE_H_ | 34 #endif // CHROME_TEST_UI_UI_TEST_SUITE_H_ |
| OLD | NEW |