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

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: 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
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("en-US", NULL, true);
72 72
73 #elif defined(OS_IOS) || defined(OS_ANDROID) 73 #elif defined(OS_IOS) || defined(OS_ANDROID)
74 // On iOS, the ui_unittests binary is itself a mini bundle, with resources 74 // 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. 75 // built in. On Android, ui_unittests_apk provides the necessary framework.
76 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); 76 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL, true);
77 77
78 #else 78 #else
79 // On other platforms, the (hardcoded) paths for chrome_100_percent.pak and 79 // 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, 80 // locale.pak get populated by later build steps. To avoid clobbering them,
81 // load the test .pak files directly. 81 // load the test .pak files directly.
82 ui::ResourceBundle::InitSharedInstanceWithPakPath( 82 ui::ResourceBundle::InitSharedInstanceWithPakPath(
83 exe_path.AppendASCII("ui_test.pak")); 83 exe_path.AppendASCII("ui_test.pak"));
84 84
85 // ui_unittests can't depend on the locales folder which Chrome will make 85 // ui_unittests can't depend on the locales folder which Chrome will make
86 // later, so use the path created by ui_test_pak. 86 // later, so use the path created by ui_test_pak.
(...skipping 13 matching lines...) Expand all
100 } // namespace 100 } // namespace
101 101
102 int main(int argc, char** argv) { 102 int main(int argc, char** argv) {
103 UIBaseTestSuite test_suite(argc, argv); 103 UIBaseTestSuite test_suite(argc, argv);
104 104
105 return base::LaunchUnitTests(argc, 105 return base::LaunchUnitTests(argc,
106 argv, 106 argv,
107 base::Bind(&UIBaseTestSuite::Run, 107 base::Bind(&UIBaseTestSuite::Run,
108 base::Unretained(&test_suite))); 108 base::Unretained(&test_suite)));
109 } 109 }
OLDNEW
« ui/base/resource/resource_bundle.h ('K') | « ui/base/resource/resource_bundle.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698