| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/ui/ui_test.h" | 5 #include "chrome/test/ui/ui_test.h" |
| 6 | 6 |
| 7 #if defined(OS_POSIX) | 7 #if defined(OS_POSIX) |
| 8 #include <signal.h> | 8 #include <signal.h> |
| 9 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 #endif | 10 #endif |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #include "base/win_util.h" | 46 #include "base/win_util.h" |
| 47 #endif | 47 #endif |
| 48 | 48 |
| 49 | 49 |
| 50 using base::Time; | 50 using base::Time; |
| 51 using base::TimeDelta; | 51 using base::TimeDelta; |
| 52 using base::TimeTicks; | 52 using base::TimeTicks; |
| 53 | 53 |
| 54 // Delay to let browser complete a requested action. | 54 // Delay to let browser complete a requested action. |
| 55 static const int kWaitForActionMsec = 2000; | 55 static const int kWaitForActionMsec = 2000; |
| 56 static const int kWaitForActionMaxMsec = 60000; | 56 static const int kWaitForActionMaxMsec = 15000; |
| 57 // Command execution timeout passed to AutomationProxy. | 57 // Command execution timeout passed to AutomationProxy. |
| 58 static const int kCommandExecutionTimeout = 30000; | 58 static const int kCommandExecutionTimeout = 15000; |
| 59 // Delay to let the browser shut down before trying more brutal methods. | 59 // Delay to let the browser shut down before trying more brutal methods. |
| 60 static const int kWaitForTerminateMsec = 30000; | 60 static const int kWaitForTerminateMsec = 15000; |
| 61 // Passed as value of kTestType. | 61 // Passed as value of kTestType. |
| 62 static const char kUITestType[] = "ui"; | 62 static const char kUITestType[] = "ui"; |
| 63 | 63 |
| 64 const wchar_t UITestBase::kFailedNoCrashService[] = | 64 const wchar_t UITestBase::kFailedNoCrashService[] = |
| 65 #if defined(OS_WIN) | 65 #if defined(OS_WIN) |
| 66 L"NOTE: This test is expected to fail if crash_service.exe is not " | 66 L"NOTE: This test is expected to fail if crash_service.exe is not " |
| 67 L"running. Start it manually before running this test (see the build " | 67 L"running. Start it manually before running this test (see the build " |
| 68 L"output directory)."; | 68 L"output directory)."; |
| 69 #elif defined(OS_LINUX) | 69 #elif defined(OS_LINUX) |
| 70 L"NOTE: This test is expected to fail if breakpad is not built in " | 70 L"NOTE: This test is expected to fail if breakpad is not built in " |
| 71 L"or if chromium is not running headless (try CHROME_HEADLESS=1)."; | 71 L"or if chromium is not running headless (try CHROME_HEADLESS=1)."; |
| 72 #else | 72 #else |
| 73 L"NOTE: Crash service not ported to this platform!"; | 73 L"NOTE: Crash service not ported to this platform!"; |
| 74 #endif | 74 #endif |
| 75 bool UITestBase::in_process_renderer_ = false; | 75 bool UITestBase::in_process_renderer_ = false; |
| 76 bool UITestBase::no_sandbox_ = false; | 76 bool UITestBase::no_sandbox_ = false; |
| 77 bool UITestBase::full_memory_dump_ = false; | 77 bool UITestBase::full_memory_dump_ = false; |
| 78 bool UITestBase::safe_plugins_ = false; | 78 bool UITestBase::safe_plugins_ = false; |
| 79 bool UITestBase::show_error_dialogs_ = true; | 79 bool UITestBase::show_error_dialogs_ = true; |
| 80 bool UITestBase::dump_histograms_on_exit_ = false; | 80 bool UITestBase::dump_histograms_on_exit_ = false; |
| 81 bool UITestBase::enable_dcheck_ = false; | 81 bool UITestBase::enable_dcheck_ = false; |
| 82 bool UITestBase::silent_dump_on_dcheck_ = false; | 82 bool UITestBase::silent_dump_on_dcheck_ = false; |
| 83 bool UITestBase::disable_breakpad_ = false; | 83 bool UITestBase::disable_breakpad_ = false; |
| 84 int UITestBase::timeout_ms_ = 20 * 60 * 1000; | 84 int UITestBase::timeout_ms_ = 5 * 60 * 1000; |
| 85 std::wstring UITestBase::js_flags_ = L""; | 85 std::wstring UITestBase::js_flags_ = L""; |
| 86 std::wstring UITestBase::log_level_ = L""; | 86 std::wstring UITestBase::log_level_ = L""; |
| 87 | 87 |
| 88 // Specify the time (in milliseconds) that the ui_tests should wait before | 88 // Specify the time (in milliseconds) that the ui_tests should wait before |
| 89 // timing out. This is used to specify longer timeouts when running under Purify | 89 // timing out. This is used to specify longer timeouts when running under Purify |
| 90 // which requires much more time. | 90 // which requires much more time. |
| 91 const char kUiTestTimeout[] = "ui-test-timeout"; | 91 const char kUiTestTimeout[] = "ui-test-timeout"; |
| 92 const char kUiTestActionTimeout[] = "ui-test-action-timeout"; | 92 const char kUiTestActionTimeout[] = "ui-test-action-timeout"; |
| 93 const char kUiTestActionMaxTimeout[] = "ui-test-action-max-timeout"; | 93 const char kUiTestActionMaxTimeout[] = "ui-test-action-max-timeout"; |
| 94 const char kUiTestSleepTimeout[] = "ui-test-sleep-timeout"; | 94 const char kUiTestSleepTimeout[] = "ui-test-sleep-timeout"; |
| (...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1526 set_ui_test_name(ASCIIToWide(test_name)); | 1526 set_ui_test_name(ASCIIToWide(test_name)); |
| 1527 } | 1527 } |
| 1528 UITestBase::SetUp(); | 1528 UITestBase::SetUp(); |
| 1529 PlatformTest::SetUp(); | 1529 PlatformTest::SetUp(); |
| 1530 } | 1530 } |
| 1531 | 1531 |
| 1532 void UITest::TearDown() { | 1532 void UITest::TearDown() { |
| 1533 UITestBase::TearDown(); | 1533 UITestBase::TearDown(); |
| 1534 PlatformTest::TearDown(); | 1534 PlatformTest::TearDown(); |
| 1535 } | 1535 } |
| OLD | NEW |