| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_unit_test_suite.h" | 5 #include "chrome/test/base/chrome_unit_test_suite.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/process/process_handle.h" | 9 #include "base/process/process_handle.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "chrome/browser/chrome_content_browser_client.h" | 12 #include "chrome/browser/chrome_content_browser_client.h" |
| 13 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 13 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
| 14 #include "chrome/browser/update_client/chrome_update_query_params_delegate.h" | 14 #include "chrome/browser/update_client/chrome_update_query_params_delegate.h" |
| 15 #include "chrome/common/chrome_content_client.h" | 15 #include "chrome/common/chrome_content_client.h" |
| 16 #include "chrome/common/chrome_paths.h" | 16 #include "chrome/common/chrome_paths.h" |
| 17 #include "chrome/test/base/testing_browser_process.h" | 17 #include "chrome/test/base/testing_browser_process.h" |
| 18 #include "chrome/utility/chrome_content_utility_client.h" | 18 #include "chrome/utility/chrome_content_utility_client.h" |
| 19 #include "components/component_updater/component_updater_paths.h" | 19 #include "components/component_updater/component_updater_paths.h" |
| 20 #include "components/translate/content/browser/browser_cld_data_provider_factory
.h" | |
| 21 #include "components/translate/content/common/cld_data_source.h" | |
| 22 #include "components/update_client/update_query_params.h" | 20 #include "components/update_client/update_query_params.h" |
| 23 #include "content/public/common/content_paths.h" | 21 #include "content/public/common/content_paths.h" |
| 24 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 25 #include "ui/base/resource/resource_bundle.h" | 23 #include "ui/base/resource/resource_bundle.h" |
| 26 #include "ui/base/resource/resource_handle.h" | 24 #include "ui/base/resource/resource_handle.h" |
| 27 #include "ui/base/ui_base_paths.h" | 25 #include "ui/base/ui_base_paths.h" |
| 28 #include "ui/gl/test/gl_surface_test_support.h" | 26 #include "ui/gl/test/gl_surface_test_support.h" |
| 29 | 27 |
| 30 #if defined(OS_CHROMEOS) | 28 #if defined(OS_CHROMEOS) |
| 31 #include "chromeos/chromeos_paths.h" | 29 #include "chromeos/chromeos_paths.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 119 |
| 122 void ChromeUnitTestSuite::InitializeProviders() { | 120 void ChromeUnitTestSuite::InitializeProviders() { |
| 123 { | 121 { |
| 124 ChromeContentClient content_client; | 122 ChromeContentClient content_client; |
| 125 RegisterContentSchemes(&content_client); | 123 RegisterContentSchemes(&content_client); |
| 126 } | 124 } |
| 127 | 125 |
| 128 chrome::RegisterPathProvider(); | 126 chrome::RegisterPathProvider(); |
| 129 content::RegisterPathProvider(); | 127 content::RegisterPathProvider(); |
| 130 ui::RegisterPathProvider(); | 128 ui::RegisterPathProvider(); |
| 131 translate::BrowserCldDataProviderFactory::SetDefault( | |
| 132 new translate::BrowserCldDataProviderFactory()); | |
| 133 translate::CldDataSource::SetDefault( | |
| 134 translate::CldDataSource::GetStaticDataSource()); | |
| 135 component_updater::RegisterPathProvider(chrome::DIR_COMPONENTS, | 129 component_updater::RegisterPathProvider(chrome::DIR_COMPONENTS, |
| 136 chrome::DIR_USER_DATA); | 130 chrome::DIR_USER_DATA); |
| 137 | 131 |
| 138 #if defined(OS_CHROMEOS) | 132 #if defined(OS_CHROMEOS) |
| 139 chromeos::RegisterPathProvider(); | 133 chromeos::RegisterPathProvider(); |
| 140 #endif | 134 #endif |
| 141 | 135 |
| 142 #if defined(ENABLE_EXTENSIONS) | 136 #if defined(ENABLE_EXTENSIONS) |
| 143 extensions::RegisterPathProvider(); | 137 extensions::RegisterPathProvider(); |
| 144 | 138 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 158 void ChromeUnitTestSuite::InitializeResourceBundle() { | 152 void ChromeUnitTestSuite::InitializeResourceBundle() { |
| 159 // Force unittests to run using en-US so if we test against string | 153 // Force unittests to run using en-US so if we test against string |
| 160 // output, it'll pass regardless of the system language. | 154 // output, it'll pass regardless of the system language. |
| 161 ui::ResourceBundle::InitSharedInstanceWithLocale( | 155 ui::ResourceBundle::InitSharedInstanceWithLocale( |
| 162 "en-US", NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES); | 156 "en-US", NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES); |
| 163 base::FilePath resources_pack_path; | 157 base::FilePath resources_pack_path; |
| 164 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); | 158 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); |
| 165 ResourceBundle::GetSharedInstance().AddDataPackFromPath( | 159 ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
| 166 resources_pack_path, ui::SCALE_FACTOR_NONE); | 160 resources_pack_path, ui::SCALE_FACTOR_NONE); |
| 167 } | 161 } |
| OLD | NEW |