| 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 // Creates an instance of the test_shell. | 5 // Creates an instance of the test_shell. |
| 6 #include "build/build_config.h" | 6 #include "build/build_config.h" |
| 7 | 7 |
| 8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 TestShell::SetAllowScriptsToCloseWindows(); | 144 TestShell::SetAllowScriptsToCloseWindows(); |
| 145 | 145 |
| 146 // Disable user themes for layout tests so pixel tests are consistent. | 146 // Disable user themes for layout tests so pixel tests are consistent. |
| 147 if (layout_test_mode) { | 147 if (layout_test_mode) { |
| 148 platform.SelectUnifiedTheme(); | 148 platform.SelectUnifiedTheme(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 if (parsed_command_line.HasSwitch(test_shell::kTestShellTimeOut)) { | 151 if (parsed_command_line.HasSwitch(test_shell::kTestShellTimeOut)) { |
| 152 const std::wstring timeout_str = parsed_command_line.GetSwitchValue( | 152 const std::wstring timeout_str = parsed_command_line.GetSwitchValue( |
| 153 test_shell::kTestShellTimeOut); | 153 test_shell::kTestShellTimeOut); |
| 154 int timeout_ms = static_cast<int>(StringToInt64(timeout_str.c_str())); | 154 int timeout_ms = |
| 155 static_cast<int>(StringToInt64(WideToUTF16Hack(timeout_str.c_str()))); |
| 155 if (timeout_ms > 0) | 156 if (timeout_ms > 0) |
| 156 TestShell::SetFileTestTimeout(timeout_ms); | 157 TestShell::SetFileTestTimeout(timeout_ms); |
| 157 } | 158 } |
| 158 | 159 |
| 159 // Treat the first loose value as the initial URL to open. | 160 // Treat the first loose value as the initial URL to open. |
| 160 std::wstring uri; | 161 std::wstring uri; |
| 161 | 162 |
| 162 // Default to a homepage if we're interactive. | 163 // Default to a homepage if we're interactive. |
| 163 if (!layout_test_mode) { | 164 if (!layout_test_mode) { |
| 164 PathService::Get(base::DIR_SOURCE_ROOT, &uri); | 165 PathService::Get(base::DIR_SOURCE_ROOT, &uri); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 | 290 |
| 290 TestShell::ShutdownTestShell(); | 291 TestShell::ShutdownTestShell(); |
| 291 TestShell::CleanupLogging(); | 292 TestShell::CleanupLogging(); |
| 292 | 293 |
| 293 // Tear down shared StatsTable; prevents unit_tests from leaking it. | 294 // Tear down shared StatsTable; prevents unit_tests from leaking it. |
| 294 StatsTable::set_current(NULL); | 295 StatsTable::set_current(NULL); |
| 295 delete table; | 296 delete table; |
| 296 | 297 |
| 297 return 0; | 298 return 0; |
| 298 } | 299 } |
| OLD | NEW |