OLD | NEW |
---|---|
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 Loading... | |
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, u::ResourceBundle::LOAD_COMMON_RESOURCES); | |
tony
2014/08/12 16:32:50
Typo: Missing i
tfarina
2014/08/13 05:11:43
doing patches at 1:00AM, that is what happens ;)
| |
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, u::ResourceBundle::LOAD_COMMON_RESOURCES); | |
tony
2014/08/12 16:32:50
Same here.
tfarina
2014/08/13 05:11:43
Done.
| |
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 Loading... | |
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 } |
OLD | NEW |