| 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" |
| 16 #include "content/public/common/content_paths.h" | 17 #include "content/public/common/content_paths.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 18 #include "ui/base/resource/resource_bundle.h" | 19 #include "ui/base/resource/resource_bundle.h" |
| 19 #include "ui/base/resource/resource_handle.h" | 20 #include "ui/base/resource/resource_handle.h" |
| 20 #include "ui/base/ui_base_paths.h" | 21 #include "ui/base/ui_base_paths.h" |
| 21 | 22 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 #if !defined(OS_IOS) | 138 #if !defined(OS_IOS) |
| 138 extensions::RegisterPathProvider(); | 139 extensions::RegisterPathProvider(); |
| 139 | 140 |
| 140 extensions::ExtensionsClient::Set( | 141 extensions::ExtensionsClient::Set( |
| 141 extensions::ChromeExtensionsClient::GetInstance()); | 142 extensions::ChromeExtensionsClient::GetInstance()); |
| 142 | 143 |
| 143 content::WebUIControllerFactory::RegisterFactory( | 144 content::WebUIControllerFactory::RegisterFactory( |
| 144 ChromeWebUIControllerFactory::GetInstance()); | 145 ChromeWebUIControllerFactory::GetInstance()); |
| 145 | 146 |
| 146 gfx::GLSurface::InitializeOneOffForTests(); | 147 gfx::GLSurface::InitializeOneOffForTests(); |
| 148 |
| 149 OmahaQueryParamsDelegate::Set(ChromeOmahaQueryParamsDelegate::GetInstance()); |
| 147 #endif | 150 #endif |
| 148 } | 151 } |
| 149 | 152 |
| 150 void ChromeUnitTestSuite::InitializeResourceBundle() { | 153 void ChromeUnitTestSuite::InitializeResourceBundle() { |
| 151 // Force unittests to run using en-US so if we test against string | 154 // Force unittests to run using en-US so if we test against string |
| 152 // output, it'll pass regardless of the system language. | 155 // output, it'll pass regardless of the system language. |
| 153 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); | 156 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); |
| 154 base::FilePath resources_pack_path; | 157 base::FilePath resources_pack_path; |
| 155 #if defined(OS_MACOSX) && !defined(OS_IOS) | 158 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 156 PathService::Get(base::DIR_MODULE, &resources_pack_path); | 159 PathService::Get(base::DIR_MODULE, &resources_pack_path); |
| 157 resources_pack_path = | 160 resources_pack_path = |
| 158 resources_pack_path.Append(FILE_PATH_LITERAL("resources.pak")); | 161 resources_pack_path.Append(FILE_PATH_LITERAL("resources.pak")); |
| 159 #else | 162 #else |
| 160 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); | 163 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); |
| 161 #endif | 164 #endif |
| 162 ResourceBundle::GetSharedInstance().AddDataPackFromPath( | 165 ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
| 163 resources_pack_path, ui::SCALE_FACTOR_NONE); | 166 resources_pack_path, ui::SCALE_FACTOR_NONE); |
| 164 } | 167 } |
| OLD | NEW |