Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: ui/base/test/run_all_unittests.cc

Issue 457103003: Merge ResourceBundle's InitSharedInstanceLocaleOnly with InitSharedInstanceWithLocale(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: REBASE Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/resource/resource_bundle.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/test/launcher/unit_test_launcher.h" 8 #include "base/test/launcher/unit_test_launcher.h"
9 #include "base/test/test_suite.h" 9 #include "base/test/test_suite.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 gfx::RegisterPathProvider(); 61 gfx::RegisterPathProvider();
62 62
63 base::FilePath exe_path; 63 base::FilePath exe_path;
64 PathService::Get(base::DIR_EXE, &exe_path); 64 PathService::Get(base::DIR_EXE, &exe_path);
65 65
66 #if defined(OS_MACOSX) && !defined(OS_IOS) 66 #if defined(OS_MACOSX) && !defined(OS_IOS)
67 // On Mac, a test Framework bundle is created that links locale.pak and 67 // On Mac, a test Framework bundle is created that links locale.pak and
68 // chrome_100_percent.pak at the appropriate places to ui_test.pak. 68 // chrome_100_percent.pak at the appropriate places to ui_test.pak.
69 base::mac::SetOverrideFrameworkBundlePath( 69 base::mac::SetOverrideFrameworkBundlePath(
70 exe_path.AppendASCII("ui_unittests Framework.framework")); 70 exe_path.AppendASCII("ui_unittests Framework.framework"));
71 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); 71 ui::ResourceBundle::InitSharedInstanceWithLocale(
72 "en-US", NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES);
72 73
73 #elif defined(OS_IOS) || defined(OS_ANDROID) 74 #elif defined(OS_IOS) || defined(OS_ANDROID)
74 // On iOS, the ui_unittests binary is itself a mini bundle, with resources 75 // On iOS, the ui_unittests binary is itself a mini bundle, with resources
75 // built in. On Android, ui_unittests_apk provides the necessary framework. 76 // built in. On Android, ui_unittests_apk provides the necessary framework.
76 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); 77 ui::ResourceBundle::InitSharedInstanceWithLocale(
78 "en-US", NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES);
77 79
78 #else 80 #else
79 // On other platforms, the (hardcoded) paths for chrome_100_percent.pak and 81 // On other platforms, the (hardcoded) paths for chrome_100_percent.pak and
80 // locale.pak get populated by later build steps. To avoid clobbering them, 82 // locale.pak get populated by later build steps. To avoid clobbering them,
81 // load the test .pak files directly. 83 // load the test .pak files directly.
82 ui::ResourceBundle::InitSharedInstanceWithPakPath( 84 ui::ResourceBundle::InitSharedInstanceWithPakPath(
83 exe_path.AppendASCII("ui_test.pak")); 85 exe_path.AppendASCII("ui_test.pak"));
84 86
85 // ui_unittests can't depend on the locales folder which Chrome will make 87 // ui_unittests can't depend on the locales folder which Chrome will make
86 // later, so use the path created by ui_test_pak. 88 // later, so use the path created by ui_test_pak.
(...skipping 13 matching lines...) Expand all
100 } // namespace 102 } // namespace
101 103
102 int main(int argc, char** argv) { 104 int main(int argc, char** argv) {
103 UIBaseTestSuite test_suite(argc, argv); 105 UIBaseTestSuite test_suite(argc, argv);
104 106
105 return base::LaunchUnitTests(argc, 107 return base::LaunchUnitTests(argc,
106 argv, 108 argv,
107 base::Bind(&UIBaseTestSuite::Run, 109 base::Bind(&UIBaseTestSuite::Run,
108 base::Unretained(&test_suite))); 110 base::Unretained(&test_suite)));
109 } 111 }
OLDNEW
« no previous file with comments | « ui/base/resource/resource_bundle.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698