| 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 command_line.AppendSwitch(switches::kSafePlugins); | 285 command_line.AppendSwitch(switches::kSafePlugins); |
| 286 if (enable_dcheck_) | 286 if (enable_dcheck_) |
| 287 command_line.AppendSwitch(switches::kEnableDCHECK); | 287 command_line.AppendSwitch(switches::kEnableDCHECK); |
| 288 if (silent_dump_on_dcheck_) | 288 if (silent_dump_on_dcheck_) |
| 289 command_line.AppendSwitch(switches::kSilentDumpOnDCHECK); | 289 command_line.AppendSwitch(switches::kSilentDumpOnDCHECK); |
| 290 if (disable_breakpad_) | 290 if (disable_breakpad_) |
| 291 command_line.AppendSwitch(switches::kDisableBreakpad); | 291 command_line.AppendSwitch(switches::kDisableBreakpad); |
| 292 if (!homepage_.empty()) | 292 if (!homepage_.empty()) |
| 293 command_line.AppendSwitchWithValue(switches::kHomePage, | 293 command_line.AppendSwitchWithValue(switches::kHomePage, |
| 294 homepage_); | 294 homepage_); |
| 295 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir_); | 295 #if defined(OS_POSIX) |
| 296 const char* alternative_userdir = getenv("CHROME_UI_TESTS_USER_DATA_DIR"); |
| 297 #else |
| 298 const FilePath::StringType::value_type* const alternative_userdir = NULL; |
| 299 #endif |
| 300 |
| 301 if (alternative_userdir) { |
| 302 user_data_dir_ = FilePath(alternative_userdir); |
| 303 } else { |
| 304 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir_); |
| 305 } |
| 306 |
| 296 if (!user_data_dir_.empty()) | 307 if (!user_data_dir_.empty()) |
| 297 command_line.AppendSwitchWithValue(switches::kUserDataDir, | 308 command_line.AppendSwitchWithValue(switches::kUserDataDir, |
| 298 user_data_dir_.ToWStringHack()); | 309 user_data_dir_.ToWStringHack()); |
| 299 if (!js_flags_.empty()) | 310 if (!js_flags_.empty()) |
| 300 command_line.AppendSwitchWithValue(switches::kJavaScriptFlags, | 311 command_line.AppendSwitchWithValue(switches::kJavaScriptFlags, |
| 301 js_flags_); | 312 js_flags_); |
| 302 if (!log_level_.empty()) | 313 if (!log_level_.empty()) |
| 303 command_line.AppendSwitchWithValue(switches::kLoggingLevel, log_level_); | 314 command_line.AppendSwitchWithValue(switches::kLoggingLevel, log_level_); |
| 304 | 315 |
| 305 command_line.AppendSwitch(switches::kMetricsRecordingOnly); | 316 command_line.AppendSwitch(switches::kMetricsRecordingOnly); |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 } | 873 } |
| 863 | 874 |
| 864 bool UITest::EvictFileFromSystemCacheWrapper(const FilePath& path) { | 875 bool UITest::EvictFileFromSystemCacheWrapper(const FilePath& path) { |
| 865 for (int i = 0; i < 10; i++) { | 876 for (int i = 0; i < 10; i++) { |
| 866 if (file_util::EvictFileFromSystemCache(path)) | 877 if (file_util::EvictFileFromSystemCache(path)) |
| 867 return true; | 878 return true; |
| 868 PlatformThread::Sleep(1000); | 879 PlatformThread::Sleep(1000); |
| 869 } | 880 } |
| 870 return false; | 881 return false; |
| 871 } | 882 } |
| OLD | NEW |