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 <string> | 8 #include <string> |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 scoped_host_resolver_proc_.Init(host_resolver_proc_.get()); | 79 scoped_host_resolver_proc_.Init(host_resolver_proc_.get()); |
80 | 80 |
81 chrome::RegisterPathProvider(); | 81 chrome::RegisterPathProvider(); |
82 app::RegisterPathProvider(); | 82 app::RegisterPathProvider(); |
83 g_browser_process = new TestingBrowserProcess; | 83 g_browser_process = new TestingBrowserProcess; |
84 | 84 |
85 // Notice a user data override, and otherwise default to using a custom | 85 // Notice a user data override, and otherwise default to using a custom |
86 // user data directory that lives alongside the current app. | 86 // user data directory that lives alongside the current app. |
87 // NOTE: The user data directory will be erased before each UI test that | 87 // NOTE: The user data directory will be erased before each UI test that |
88 // uses it, in order to ensure consistency. | 88 // uses it, in order to ensure consistency. |
89 FilePath user_data_dir = FilePath::FromWStringHack( | 89 FilePath user_data_dir = |
90 CommandLine::ForCurrentProcess()->GetSwitchValue( | 90 CommandLine::ForCurrentProcess()->GetSwitchValuePath( |
91 switches::kUserDataDir)); | 91 switches::kUserDataDir); |
92 if (user_data_dir.empty() && | 92 if (user_data_dir.empty() && |
93 file_util::CreateNewTempDirectory(FILE_PATH_LITERAL("chrome_test_"), | 93 file_util::CreateNewTempDirectory(FILE_PATH_LITERAL("chrome_test_"), |
94 &user_data_dir)) { | 94 &user_data_dir)) { |
95 user_data_dir = user_data_dir.AppendASCII("test_user_data"); | 95 user_data_dir = user_data_dir.AppendASCII("test_user_data"); |
96 } | 96 } |
97 if (!user_data_dir.empty()) | 97 if (!user_data_dir.empty()) |
98 PathService::Override(chrome::DIR_USER_DATA, user_data_dir); | 98 PathService::Override(chrome::DIR_USER_DATA, user_data_dir); |
99 | 99 |
100 #if defined(OS_MACOSX) | 100 #if defined(OS_MACOSX) |
101 // Look in the framework bundle for resources. | 101 // Look in the framework bundle for resources. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 TestSuite::Shutdown(); | 141 TestSuite::Shutdown(); |
142 } | 142 } |
143 | 143 |
144 StatsTable* stats_table_; | 144 StatsTable* stats_table_; |
145 ScopedOleInitializer ole_initializer_; | 145 ScopedOleInitializer ole_initializer_; |
146 scoped_refptr<WarningHostResolverProc> host_resolver_proc_; | 146 scoped_refptr<WarningHostResolverProc> host_resolver_proc_; |
147 net::ScopedDefaultHostResolverProc scoped_host_resolver_proc_; | 147 net::ScopedDefaultHostResolverProc scoped_host_resolver_proc_; |
148 }; | 148 }; |
149 | 149 |
150 #endif // CHROME_TEST_UNIT_CHROME_TEST_SUITE_H_ | 150 #endif // CHROME_TEST_UNIT_CHROME_TEST_SUITE_H_ |
OLD | NEW |