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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/metrics/statistics_recorder.h" | 7 #include "base/metrics/statistics_recorder.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/test/launcher/unit_test_launcher.h" | 9 #include "base/test/launcher/unit_test_launcher.h" |
10 #include "base/test/test_suite.h" | 10 #include "base/test/test_suite.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 base::mac::SetOverrideFrameworkBundlePath(path); | 76 base::mac::SetOverrideFrameworkBundlePath(path); |
77 #endif | 77 #endif |
78 | 78 |
79 ui::RegisterPathProvider(); | 79 ui::RegisterPathProvider(); |
80 | 80 |
81 // TODO(tfarina): This should be changed to InitSharedInstanceWithPakFile() | 81 // TODO(tfarina): This should be changed to InitSharedInstanceWithPakFile() |
82 // so we can load our pak file instead of chrome.pak. crbug.com/348563 | 82 // so we can load our pak file instead of chrome.pak. crbug.com/348563 |
83 ui::ResourceBundle::InitSharedInstanceWithLocale( | 83 ui::ResourceBundle::InitSharedInstanceWithLocale( |
84 "en-US", NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES); | 84 "en-US", NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES); |
85 base::FilePath resources_pack_path; | 85 base::FilePath resources_pack_dir; |
86 PathService::Get(base::DIR_MODULE, &resources_pack_path); | 86 #if defined(OS_ANDROID) |
| 87 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &resources_pack_dir); |
| 88 #else |
| 89 PathService::Get(base::DIR_MODULE, &resources_pack_dir); |
| 90 #endif |
87 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( | 91 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
88 resources_pack_path.AppendASCII("resources.pak"), | 92 resources_pack_dir.AppendASCII("resources.pak"), |
89 ui::SCALE_FACTOR_NONE); | 93 ui::SCALE_FACTOR_NONE); |
90 | 94 |
91 // These schemes need to be added globally to pass tests of | 95 // These schemes need to be added globally to pass tests of |
92 // autocomplete_input_unittest.cc and content_settings_pattern* | 96 // autocomplete_input_unittest.cc and content_settings_pattern* |
93 url::AddStandardScheme("chrome"); | 97 url::AddStandardScheme("chrome"); |
94 url::AddStandardScheme("chrome-extension"); | 98 url::AddStandardScheme("chrome-extension"); |
95 url::AddStandardScheme("chrome-devtools"); | 99 url::AddStandardScheme("chrome-devtools"); |
96 url::AddStandardScheme("chrome-search"); | 100 url::AddStandardScheme("chrome-search"); |
97 | 101 |
98 // Not using kExtensionScheme to avoid the dependency to extensions. | 102 // Not using kExtensionScheme to avoid the dependency to extensions. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // The listener will set up common test environment for all components unit | 144 // The listener will set up common test environment for all components unit |
141 // tests. | 145 // tests. |
142 testing::TestEventListeners& listeners = | 146 testing::TestEventListeners& listeners = |
143 testing::UnitTest::GetInstance()->listeners(); | 147 testing::UnitTest::GetInstance()->listeners(); |
144 listeners.Append(new ComponentsUnitTestEventListener()); | 148 listeners.Append(new ComponentsUnitTestEventListener()); |
145 | 149 |
146 return base::LaunchUnitTests( | 150 return base::LaunchUnitTests( |
147 argc, argv, base::Bind(&base::TestSuite::Run, | 151 argc, argv, base::Bind(&base::TestSuite::Run, |
148 base::Unretained(&test_suite))); | 152 base::Unretained(&test_suite))); |
149 } | 153 } |
OLD | NEW |