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/update_client/update_query_params.h" | 20 #include "components/update_client/update_query_params.h" |
21 #include "content/public/common/content_paths.h" | 21 #include "content/public/common/content_paths.h" |
22 #include "extensions/features/features.h" | 22 #include "extensions/features/features.h" |
| 23 #include "gpu/ipc/service/image_transport_surface.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
24 #include "ui/base/resource/resource_bundle.h" | 25 #include "ui/base/resource/resource_bundle.h" |
25 #include "ui/base/resource/resource_handle.h" | 26 #include "ui/base/resource/resource_handle.h" |
26 #include "ui/base/ui_base_paths.h" | 27 #include "ui/base/ui_base_paths.h" |
27 #include "ui/gl/test/gl_surface_test_support.h" | 28 #include "ui/gl/test/gl_surface_test_support.h" |
28 | 29 |
29 #if defined(OS_CHROMEOS) | 30 #if defined(OS_CHROMEOS) |
30 #include "chromeos/chromeos_paths.h" | 31 #include "chromeos/chromeos_paths.h" |
31 #endif | 32 #endif |
32 | 33 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 141 |
141 extensions::ExtensionsClient::Set( | 142 extensions::ExtensionsClient::Set( |
142 extensions::ChromeExtensionsClient::GetInstance()); | 143 extensions::ChromeExtensionsClient::GetInstance()); |
143 #endif | 144 #endif |
144 | 145 |
145 content::WebUIControllerFactory::RegisterFactory( | 146 content::WebUIControllerFactory::RegisterFactory( |
146 ChromeWebUIControllerFactory::GetInstance()); | 147 ChromeWebUIControllerFactory::GetInstance()); |
147 | 148 |
148 gl::GLSurfaceTestSupport::InitializeOneOff(); | 149 gl::GLSurfaceTestSupport::InitializeOneOff(); |
149 | 150 |
| 151 #if defined(OS_MACOSX) |
| 152 gpu::ImageTransportSurface::SetAllowOSMesaForTesting(true); |
| 153 #endif |
| 154 |
150 update_client::UpdateQueryParams::SetDelegate( | 155 update_client::UpdateQueryParams::SetDelegate( |
151 ChromeUpdateQueryParamsDelegate::GetInstance()); | 156 ChromeUpdateQueryParamsDelegate::GetInstance()); |
152 } | 157 } |
153 | 158 |
154 void ChromeUnitTestSuite::InitializeResourceBundle() { | 159 void ChromeUnitTestSuite::InitializeResourceBundle() { |
155 // Force unittests to run using en-US so if we test against string | 160 // Force unittests to run using en-US so if we test against string |
156 // output, it'll pass regardless of the system language. | 161 // output, it'll pass regardless of the system language. |
157 ui::ResourceBundle::InitSharedInstanceWithLocale( | 162 ui::ResourceBundle::InitSharedInstanceWithLocale( |
158 "en-US", NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES); | 163 "en-US", NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES); |
159 base::FilePath resources_pack_path; | 164 base::FilePath resources_pack_path; |
160 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); | 165 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); |
161 ResourceBundle::GetSharedInstance().AddDataPackFromPath( | 166 ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
162 resources_pack_path, ui::SCALE_FACTOR_NONE); | 167 resources_pack_path, ui::SCALE_FACTOR_NONE); |
163 } | 168 } |
OLD | NEW |