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_dir; | 85 base::FilePath resources_pack_path; |
86 #if defined(OS_ANDROID) | 86 PathService::Get(base::DIR_MODULE, &resources_pack_path); |
87 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &resources_pack_dir); | |
88 #else | |
89 PathService::Get(base::DIR_MODULE, &resources_pack_dir); | |
90 #endif | |
91 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( | 87 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
92 resources_pack_dir.AppendASCII("resources.pak"), | 88 resources_pack_path.AppendASCII("resources.pak"), |
93 ui::SCALE_FACTOR_NONE); | 89 ui::SCALE_FACTOR_NONE); |
94 | 90 |
95 // These schemes need to be added globally to pass tests of | 91 // These schemes need to be added globally to pass tests of |
96 // autocomplete_input_unittest.cc and content_settings_pattern* | 92 // autocomplete_input_unittest.cc and content_settings_pattern* |
97 url::AddStandardScheme("chrome"); | 93 url::AddStandardScheme("chrome"); |
98 url::AddStandardScheme("chrome-extension"); | 94 url::AddStandardScheme("chrome-extension"); |
99 url::AddStandardScheme("chrome-devtools"); | 95 url::AddStandardScheme("chrome-devtools"); |
100 url::AddStandardScheme("chrome-search"); | 96 url::AddStandardScheme("chrome-search"); |
101 | 97 |
102 // Not using kExtensionScheme to avoid the dependency to extensions. | 98 // Not using kExtensionScheme to avoid the dependency to extensions. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 // The listener will set up common test environment for all components unit | 140 // The listener will set up common test environment for all components unit |
145 // tests. | 141 // tests. |
146 testing::TestEventListeners& listeners = | 142 testing::TestEventListeners& listeners = |
147 testing::UnitTest::GetInstance()->listeners(); | 143 testing::UnitTest::GetInstance()->listeners(); |
148 listeners.Append(new ComponentsUnitTestEventListener()); | 144 listeners.Append(new ComponentsUnitTestEventListener()); |
149 | 145 |
150 return base::LaunchUnitTests( | 146 return base::LaunchUnitTests( |
151 argc, argv, base::Bind(&base::TestSuite::Run, | 147 argc, argv, base::Bind(&base::TestSuite::Run, |
152 base::Unretained(&test_suite))); | 148 base::Unretained(&test_suite))); |
153 } | 149 } |
OLD | NEW |