| 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/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/process/process_handle.h" | 8 #include "base/process/process_handle.h" |
| 9 #include "base/metrics/stats_table.h" | 9 #include "base/metrics/stats_table.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| 11 #include "chrome/browser/chrome_content_browser_client.h" | 11 #include "chrome/browser/chrome_content_browser_client.h" |
| 12 #include "chrome/browser/omaha_query_params/chrome_omaha_query_params_delegate.h
" |
| 12 #include "chrome/common/chrome_content_client.h" | 13 #include "chrome/common/chrome_content_client.h" |
| 13 #include "chrome/common/chrome_paths.h" | 14 #include "chrome/common/chrome_paths.h" |
| 14 #include "chrome/test/base/testing_browser_process.h" | 15 #include "chrome/test/base/testing_browser_process.h" |
| 15 #include "chrome/utility/chrome_content_utility_client.h" | 16 #include "chrome/utility/chrome_content_utility_client.h" |
| 17 #include "components/omaha_query_params/omaha_query_params.h" |
| 16 #include "content/public/common/content_paths.h" | 18 #include "content/public/common/content_paths.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 18 #include "ui/base/resource/resource_bundle.h" | 20 #include "ui/base/resource/resource_bundle.h" |
| 19 #include "ui/base/resource/resource_handle.h" | 21 #include "ui/base/resource/resource_handle.h" |
| 20 #include "ui/base/ui_base_paths.h" | 22 #include "ui/base/ui_base_paths.h" |
| 21 | 23 |
| 22 #if defined(OS_CHROMEOS) | 24 #if defined(OS_CHROMEOS) |
| 23 #include "chromeos/chromeos_paths.h" | 25 #include "chromeos/chromeos_paths.h" |
| 24 #endif | 26 #endif |
| 25 | 27 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 #if !defined(OS_IOS) | 139 #if !defined(OS_IOS) |
| 138 extensions::RegisterPathProvider(); | 140 extensions::RegisterPathProvider(); |
| 139 | 141 |
| 140 extensions::ExtensionsClient::Set( | 142 extensions::ExtensionsClient::Set( |
| 141 extensions::ChromeExtensionsClient::GetInstance()); | 143 extensions::ChromeExtensionsClient::GetInstance()); |
| 142 | 144 |
| 143 content::WebUIControllerFactory::RegisterFactory( | 145 content::WebUIControllerFactory::RegisterFactory( |
| 144 ChromeWebUIControllerFactory::GetInstance()); | 146 ChromeWebUIControllerFactory::GetInstance()); |
| 145 | 147 |
| 146 gfx::GLSurface::InitializeOneOffForTests(); | 148 gfx::GLSurface::InitializeOneOffForTests(); |
| 149 |
| 150 omaha_query_params::OmahaQueryParams::SetDelegate( |
| 151 ChromeOmahaQueryParamsDelegate::GetInstance()); |
| 147 #endif | 152 #endif |
| 148 } | 153 } |
| 149 | 154 |
| 150 void ChromeUnitTestSuite::InitializeResourceBundle() { | 155 void ChromeUnitTestSuite::InitializeResourceBundle() { |
| 151 // Force unittests to run using en-US so if we test against string | 156 // Force unittests to run using en-US so if we test against string |
| 152 // output, it'll pass regardless of the system language. | 157 // output, it'll pass regardless of the system language. |
| 153 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); | 158 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); |
| 154 base::FilePath resources_pack_path; | 159 base::FilePath resources_pack_path; |
| 155 #if defined(OS_MACOSX) && !defined(OS_IOS) | 160 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 156 PathService::Get(base::DIR_MODULE, &resources_pack_path); | 161 PathService::Get(base::DIR_MODULE, &resources_pack_path); |
| 157 resources_pack_path = | 162 resources_pack_path = |
| 158 resources_pack_path.Append(FILE_PATH_LITERAL("resources.pak")); | 163 resources_pack_path.Append(FILE_PATH_LITERAL("resources.pak")); |
| 159 #else | 164 #else |
| 160 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); | 165 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); |
| 161 #endif | 166 #endif |
| 162 ResourceBundle::GetSharedInstance().AddDataPackFromPath( | 167 ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
| 163 resources_pack_path, ui::SCALE_FACTOR_NONE); | 168 resources_pack_path, ui::SCALE_FACTOR_NONE); |
| 164 } | 169 } |
| OLD | NEW |