OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "app/sql/connection.h" | 10 #include "app/sql/connection.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 using base::TimeTicks; | 43 using base::TimeTicks; |
44 | 44 |
45 // Delay to let browser complete a requested action. | 45 // Delay to let browser complete a requested action. |
46 static const int kWaitForActionMsec = 2000; | 46 static const int kWaitForActionMsec = 2000; |
47 static const int kWaitForActionMaxMsec = 10000; | 47 static const int kWaitForActionMaxMsec = 10000; |
48 // Command execution timeout passed to AutomationProxy. | 48 // Command execution timeout passed to AutomationProxy. |
49 static const int kCommandExecutionTimeout = 30000; | 49 static const int kCommandExecutionTimeout = 30000; |
50 // Delay to let the browser shut down before trying more brutal methods. | 50 // Delay to let the browser shut down before trying more brutal methods. |
51 static const int kWaitForTerminateMsec = 30000; | 51 static const int kWaitForTerminateMsec = 30000; |
| 52 // Passed as value of kTestType. |
| 53 static const char kUITestType[] = "ui"; |
52 | 54 |
53 const wchar_t UITestBase::kFailedNoCrashService[] = | 55 const wchar_t UITestBase::kFailedNoCrashService[] = |
54 #if defined(OS_WIN) | 56 #if defined(OS_WIN) |
55 L"NOTE: This test is expected to fail if crash_service.exe is not " | 57 L"NOTE: This test is expected to fail if crash_service.exe is not " |
56 L"running. Start it manually before running this test (see the build " | 58 L"running. Start it manually before running this test (see the build " |
57 L"output directory)."; | 59 L"output directory)."; |
58 #elif defined(OS_LINUX) | 60 #elif defined(OS_LINUX) |
59 L"NOTE: This test is expected to fail if breakpad is not built in " | 61 L"NOTE: This test is expected to fail if breakpad is not built in " |
60 L"or if chromium is not running headless (try CHROME_HEADLESS=1)."; | 62 L"or if chromium is not running headless (try CHROME_HEADLESS=1)."; |
61 #else | 63 #else |
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 command_line.AppendLooseValue(flags[i]); | 1072 command_line.AppendLooseValue(flags[i]); |
1071 } | 1073 } |
1072 | 1074 |
1073 // No first-run dialogs, please. | 1075 // No first-run dialogs, please. |
1074 command_line.AppendSwitch(switches::kNoFirstRun); | 1076 command_line.AppendSwitch(switches::kNoFirstRun); |
1075 | 1077 |
1076 // No default browser check, it would create an info-bar (if we are not the | 1078 // No default browser check, it would create an info-bar (if we are not the |
1077 // default browser) that could conflicts with some tests expectations. | 1079 // default browser) that could conflicts with some tests expectations. |
1078 command_line.AppendSwitch(switches::kNoDefaultBrowserCheck); | 1080 command_line.AppendSwitch(switches::kNoDefaultBrowserCheck); |
1079 | 1081 |
| 1082 // This is a UI test. |
| 1083 command_line.AppendSwitchWithValue(switches::kTestType, |
| 1084 ASCIIToWide(kUITestType)); |
| 1085 |
1080 // We need cookies on file:// for things like the page cycler. | 1086 // We need cookies on file:// for things like the page cycler. |
1081 if (enable_file_cookies_) | 1087 if (enable_file_cookies_) |
1082 command_line.AppendSwitch(switches::kEnableFileCookies); | 1088 command_line.AppendSwitch(switches::kEnableFileCookies); |
1083 | 1089 |
1084 if (dom_automation_enabled_) | 1090 if (dom_automation_enabled_) |
1085 command_line.AppendSwitch(switches::kDomAutomationController); | 1091 command_line.AppendSwitch(switches::kDomAutomationController); |
1086 | 1092 |
1087 if (include_testing_id_) { | 1093 if (include_testing_id_) { |
1088 if (use_existing_browser) { | 1094 if (use_existing_browser) { |
1089 // TODO(erikkay): The new switch depends on a browser instance already | 1095 // TODO(erikkay): The new switch depends on a browser instance already |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1504 set_ui_test_name(ASCIIToWide(test_name)); | 1510 set_ui_test_name(ASCIIToWide(test_name)); |
1505 } | 1511 } |
1506 UITestBase::SetUp(); | 1512 UITestBase::SetUp(); |
1507 PlatformTest::SetUp(); | 1513 PlatformTest::SetUp(); |
1508 } | 1514 } |
1509 | 1515 |
1510 void UITest::TearDown() { | 1516 void UITest::TearDown() { |
1511 UITestBase::TearDown(); | 1517 UITestBase::TearDown(); |
1512 PlatformTest::TearDown(); | 1518 PlatformTest::TearDown(); |
1513 } | 1519 } |
OLD | NEW |