OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/base/chrome_test_suite.h" | 5 #include "chrome/test/base/chrome_test_suite.h" |
6 | 6 |
7 #if defined(OS_CHROMEOS) | 7 #if defined(OS_CHROMEOS) |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 #include <unistd.h> | 9 #include <unistd.h> |
10 #endif | 10 #endif |
11 | 11 |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/metrics/stats_table.h" | 15 #include "base/metrics/stats_table.h" |
16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
17 #include "base/process_util.h" | 17 #include "base/process_util.h" |
18 #include "base/stringprintf.h" | 18 #include "base/stringprintf.h" |
19 #include "base/utf_string_conversions.h" | 19 #include "base/utf_string_conversions.h" |
20 #include "chrome/browser/browser_process.h" | 20 #include "chrome/browser/browser_process.h" |
21 #include "chrome/browser/chrome_content_browser_client.h" | 21 #include "chrome/browser/chrome_content_browser_client.h" |
22 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 22 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
23 #include "chrome/common/chrome_constants.h" | 23 #include "chrome/common/chrome_constants.h" |
24 #include "chrome/common/chrome_content_client.h" | 24 #include "chrome/common/chrome_content_client.h" |
25 #include "chrome/common/chrome_paths.h" | 25 #include "chrome/common/chrome_paths.h" |
26 #include "chrome/common/url_constants.h" | 26 #include "chrome/common/url_constants.h" |
27 #include "chrome/test/base/testing_browser_process.h" | 27 #include "chrome/test/base/testing_browser_process.h" |
28 #include "content/public/test/test_launcher.h" | 28 #include "content/public/test/test_launcher.h" |
| 29 #include "extensions/common/extension_paths.h" |
29 #include "net/base/net_errors.h" | 30 #include "net/base/net_errors.h" |
30 #include "net/base/net_util.h" | 31 #include "net/base/net_util.h" |
31 #include "net/dns/mock_host_resolver.h" | 32 #include "net/dns/mock_host_resolver.h" |
32 #include "testing/gtest/include/gtest/gtest.h" | 33 #include "testing/gtest/include/gtest/gtest.h" |
33 #include "ui/base/resource/resource_bundle.h" | 34 #include "ui/base/resource/resource_bundle.h" |
34 #include "ui/base/resource/resource_handle.h" | 35 #include "ui/base/resource/resource_handle.h" |
35 | 36 |
36 #if defined(OS_ANDROID) | 37 #if defined(OS_ANDROID) |
37 #include "base/android/jni_android.h" | 38 #include "base/android/jni_android.h" |
38 #include "chrome/browser/android/chrome_jni_registrar.h" | 39 #include "chrome/browser/android/chrome_jni_registrar.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 chrome::android::RegisterJni(base::android::AttachCurrentThread()); | 210 chrome::android::RegisterJni(base::android::AttachCurrentThread()); |
210 #endif | 211 #endif |
211 | 212 |
212 chrome::RegisterPathProvider(); | 213 chrome::RegisterPathProvider(); |
213 if (!browser_dir_.empty()) { | 214 if (!browser_dir_.empty()) { |
214 PathService::Override(base::DIR_EXE, browser_dir_); | 215 PathService::Override(base::DIR_EXE, browser_dir_); |
215 PathService::Override(base::DIR_MODULE, browser_dir_); | 216 PathService::Override(base::DIR_MODULE, browser_dir_); |
216 } | 217 } |
217 | 218 |
218 #if !defined(OS_IOS) | 219 #if !defined(OS_IOS) |
| 220 extensions::RegisterPathProvider(); |
| 221 |
219 if (!content::GetCurrentTestLauncherDelegate()) { | 222 if (!content::GetCurrentTestLauncherDelegate()) { |
220 // Only want to do this for unit tests. For browser tests, this won't create | 223 // Only want to do this for unit tests. For browser tests, this won't create |
221 // the right object since TestChromeWebUIControllerFactory is used. That's | 224 // the right object since TestChromeWebUIControllerFactory is used. That's |
222 // created and registered in ChromeBrowserMainParts as in normal startup. | 225 // created and registered in ChromeBrowserMainParts as in normal startup. |
223 content::WebUIControllerFactory::RegisterFactory( | 226 content::WebUIControllerFactory::RegisterFactory( |
224 ChromeWebUIControllerFactory::GetInstance()); | 227 ChromeWebUIControllerFactory::GetInstance()); |
225 } | 228 } |
226 #endif | 229 #endif |
227 | 230 |
228 // Disable external libraries load if we are under python process in | 231 // Disable external libraries load if we are under python process in |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 #if defined(OS_MACOSX) && !defined(OS_IOS) | 281 #if defined(OS_MACOSX) && !defined(OS_IOS) |
279 base::mac::SetOverrideFrameworkBundle(NULL); | 282 base::mac::SetOverrideFrameworkBundle(NULL); |
280 #endif | 283 #endif |
281 | 284 |
282 base::StatsTable::set_current(NULL); | 285 base::StatsTable::set_current(NULL); |
283 stats_table_.reset(); | 286 stats_table_.reset(); |
284 RemoveSharedMemoryFile(stats_filename_); | 287 RemoveSharedMemoryFile(stats_filename_); |
285 | 288 |
286 base::TestSuite::Shutdown(); | 289 base::TestSuite::Shutdown(); |
287 } | 290 } |
OLD | NEW |