| 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 #ifndef CHROME_TEST_UNIT_CHROME_TEST_SUITE_H_ | 5 #ifndef CHROME_TEST_UNIT_CHROME_TEST_SUITE_H_ |
| 6 #define CHROME_TEST_UNIT_CHROME_TEST_SUITE_H_ | 6 #define CHROME_TEST_UNIT_CHROME_TEST_SUITE_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #include "base/stats_table.h" | 10 #include "base/stats_table.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 TestSuite::Initialize(); | 34 TestSuite::Initialize(); |
| 35 | 35 |
| 36 chrome::RegisterPathProvider(); | 36 chrome::RegisterPathProvider(); |
| 37 g_browser_process = new TestingBrowserProcess; | 37 g_browser_process = new TestingBrowserProcess; |
| 38 | 38 |
| 39 // Notice a user data override, and otherwise default to using a custom | 39 // Notice a user data override, and otherwise default to using a custom |
| 40 // user data directory that lives alongside the current app. | 40 // user data directory that lives alongside the current app. |
| 41 // NOTE: The user data directory will be erased before each UI test that | 41 // NOTE: The user data directory will be erased before each UI test that |
| 42 // uses it, in order to ensure consistency. | 42 // uses it, in order to ensure consistency. |
| 43 std::wstring user_data_dir = | 43 std::wstring user_data_dir = |
| 44 CommandLine().GetSwitchValue(switches::kUserDataDir); | 44 CommandLine::ForCurrentProcess()->GetSwitchValue( |
| 45 switches::kUserDataDir); |
| 45 if (user_data_dir.empty() && | 46 if (user_data_dir.empty() && |
| 46 PathService::Get(base::DIR_EXE, &user_data_dir)) | 47 PathService::Get(base::DIR_EXE, &user_data_dir)) |
| 47 file_util::AppendToPath(&user_data_dir, L"test_user_data"); | 48 file_util::AppendToPath(&user_data_dir, L"test_user_data"); |
| 48 if (!user_data_dir.empty()) | 49 if (!user_data_dir.empty()) |
| 49 PathService::Override(chrome::DIR_USER_DATA, user_data_dir); | 50 PathService::Override(chrome::DIR_USER_DATA, user_data_dir); |
| 50 | 51 |
| 51 #if defined(OS_WIN) | 52 #if defined(OS_WIN) |
| 52 // TODO(port): Remove the #ifdef when ResourceBundle is ported. | 53 // TODO(port): Remove the #ifdef when ResourceBundle is ported. |
| 53 // | 54 // |
| 54 // Force unittests to run using en-us so if we test against string | 55 // Force unittests to run using en-us so if we test against string |
| (...skipping 20 matching lines...) Expand all Loading... |
| 75 StatsTable::set_current(NULL); | 76 StatsTable::set_current(NULL); |
| 76 delete stats_table_; | 77 delete stats_table_; |
| 77 | 78 |
| 78 TestSuite::Shutdown(); | 79 TestSuite::Shutdown(); |
| 79 } | 80 } |
| 80 | 81 |
| 81 StatsTable* stats_table_; | 82 StatsTable* stats_table_; |
| 82 }; | 83 }; |
| 83 | 84 |
| 84 #endif // CHROME_TEST_UNIT_CHROME_TEST_SUITE_H_ | 85 #endif // CHROME_TEST_UNIT_CHROME_TEST_SUITE_H_ |
| OLD | NEW |