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 #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 "base/base_switches.h" | 10 #include "base/base_switches.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 // TODO(port): we don't catch crashes, nor have CountFilesCreatedAfter. | 179 // TODO(port): we don't catch crashes, nor have CountFilesCreatedAfter. |
180 NOTIMPLEMENTED(); | 180 NOTIMPLEMENTED(); |
181 #endif | 181 #endif |
182 } | 182 } |
183 | 183 |
184 // Pick up the various test time out values from the command line. | 184 // Pick up the various test time out values from the command line. |
185 void UITest::InitializeTimeouts() { | 185 void UITest::InitializeTimeouts() { |
186 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 186 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
187 if (command_line.HasSwitch(kUiTestTimeout)) { | 187 if (command_line.HasSwitch(kUiTestTimeout)) { |
188 std::wstring timeout_str = command_line.GetSwitchValue(kUiTestTimeout); | 188 std::wstring timeout_str = command_line.GetSwitchValue(kUiTestTimeout); |
189 int timeout = StringToInt(timeout_str); | 189 int timeout = StringToInt(WideToUTF16Hack(timeout_str)); |
190 command_execution_timeout_ms_ = std::max(kMaxTestExecutionTime, timeout); | 190 command_execution_timeout_ms_ = std::max(kMaxTestExecutionTime, timeout); |
191 } | 191 } |
192 | 192 |
193 if (command_line.HasSwitch(kUiTestActionTimeout)) { | 193 if (command_line.HasSwitch(kUiTestActionTimeout)) { |
194 std::wstring act_str = command_line.GetSwitchValue(kUiTestActionTimeout); | 194 std::wstring act_str = command_line.GetSwitchValue(kUiTestActionTimeout); |
195 int act_timeout = StringToInt(act_str); | 195 int act_timeout = StringToInt(WideToUTF16Hack(act_str)); |
196 action_timeout_ms_ = std::max(kWaitForActionMsec, act_timeout); | 196 action_timeout_ms_ = std::max(kWaitForActionMsec, act_timeout); |
197 } | 197 } |
198 | 198 |
199 if (command_line.HasSwitch(kUiTestActionMaxTimeout)) { | 199 if (command_line.HasSwitch(kUiTestActionMaxTimeout)) { |
200 std::wstring action_max_str = | 200 std::wstring action_max_str = |
201 command_line.GetSwitchValue(kUiTestActionMaxTimeout); | 201 command_line.GetSwitchValue(kUiTestActionMaxTimeout); |
202 int max_timeout = StringToInt(action_max_str); | 202 int max_timeout = StringToInt(WideToUTF16Hack(action_max_str)); |
203 action_max_timeout_ms_ = std::max(kWaitForActionMaxMsec, max_timeout); | 203 action_max_timeout_ms_ = std::max(kWaitForActionMaxMsec, max_timeout); |
204 } | 204 } |
205 | 205 |
206 if (CommandLine::ForCurrentProcess()->HasSwitch(kUiTestSleepTimeout)) { | 206 if (CommandLine::ForCurrentProcess()->HasSwitch(kUiTestSleepTimeout)) { |
207 std::wstring sleep_timeout_str = | 207 std::wstring sleep_timeout_str = |
208 CommandLine::ForCurrentProcess()->GetSwitchValue(kUiTestSleepTimeout); | 208 CommandLine::ForCurrentProcess()->GetSwitchValue(kUiTestSleepTimeout); |
209 int sleep_timeout = StringToInt(sleep_timeout_str); | 209 int sleep_timeout = StringToInt(WideToUTF16Hack(sleep_timeout_str)); |
210 sleep_timeout_ms_ = std::max(kWaitForActionMsec, sleep_timeout); | 210 sleep_timeout_ms_ = std::max(kWaitForActionMsec, sleep_timeout); |
211 } | 211 } |
212 } | 212 } |
213 | 213 |
214 void UITest::LaunchBrowserAndServer() { | 214 void UITest::LaunchBrowserAndServer() { |
215 #if defined(OS_WIN) | 215 #if defined(OS_WIN) |
216 // Set up IPC testing interface server. | 216 // Set up IPC testing interface server. |
217 server_.reset(new AutomationProxy(command_execution_timeout_ms_)); | 217 server_.reset(new AutomationProxy(command_execution_timeout_ms_)); |
218 | 218 |
219 LaunchBrowser(launch_arguments_, clear_profile_); | 219 LaunchBrowser(launch_arguments_, clear_profile_); |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 // <*>RESULT <graph_name>: <trace_name>= <value> <units> | 805 // <*>RESULT <graph_name>: <trace_name>= <value> <units> |
806 // <*>RESULT <graph_name>: <trace_name>= {<mean>, <std deviation>} <units> | 806 // <*>RESULT <graph_name>: <trace_name>= {<mean>, <std deviation>} <units> |
807 // <*>RESULT <graph_name>: <trace_name>= [<value>,value,value,...,] <units> | 807 // <*>RESULT <graph_name>: <trace_name>= [<value>,value,value,...,] <units> |
808 wprintf(L"%lsRESULT %ls%ls: %ls= %ls%ls%ls %ls\n", | 808 wprintf(L"%lsRESULT %ls%ls: %ls= %ls%ls%ls %ls\n", |
809 important ? L"*" : L"", measurement.c_str(), modifier.c_str(), | 809 important ? L"*" : L"", measurement.c_str(), modifier.c_str(), |
810 trace.c_str(), prefix.c_str(), values.c_str(), suffix.c_str(), | 810 trace.c_str(), prefix.c_str(), values.c_str(), suffix.c_str(), |
811 units.c_str()); | 811 units.c_str()); |
812 } | 812 } |
813 | 813 |
814 #endif // OS_WIN | 814 #endif // OS_WIN |
OLD | NEW |