| 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" |
| 11 #include "ui/base/resource/resource_bundle.h" | 11 #include "ui/base/resource/resource_bundle.h" |
| 12 #include "ui/base/ui_base_paths.h" | 12 #include "ui/base/ui_base_paths.h" |
| 13 #include "ui/gfx/gfx_paths.h" | |
| 14 | 13 |
| 15 #if defined(OS_ANDROID) | 14 #if defined(OS_ANDROID) |
| 16 #include "base/android/jni_android.h" | 15 #include "base/android/jni_android.h" |
| 17 #include "ui/base/android/ui_base_jni_registrar.h" | 16 #include "ui/base/android/ui_base_jni_registrar.h" |
| 18 #include "ui/gfx/android/gfx_jni_registrar.h" | 17 #include "ui/gfx/android/gfx_jni_registrar.h" |
| 19 #endif | 18 #endif |
| 20 | 19 |
| 21 #if defined(OS_MACOSX) && !defined(OS_IOS) | 20 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 22 #include "base/mac/bundle_locations.h" | 21 #include "base/mac/bundle_locations.h" |
| 23 #endif | 22 #endif |
| (...skipping 27 matching lines...) Expand all Loading... |
| 51 gfx::ForceHighDPISupportForTesting(1.0); | 50 gfx::ForceHighDPISupportForTesting(1.0); |
| 52 #endif | 51 #endif |
| 53 | 52 |
| 54 #if defined(OS_ANDROID) | 53 #if defined(OS_ANDROID) |
| 55 // Register JNI bindings for android. | 54 // Register JNI bindings for android. |
| 56 gfx::android::RegisterJni(base::android::AttachCurrentThread()); | 55 gfx::android::RegisterJni(base::android::AttachCurrentThread()); |
| 57 ui::android::RegisterJni(base::android::AttachCurrentThread()); | 56 ui::android::RegisterJni(base::android::AttachCurrentThread()); |
| 58 #endif | 57 #endif |
| 59 | 58 |
| 60 ui::RegisterPathProvider(); | 59 ui::RegisterPathProvider(); |
| 61 gfx::RegisterPathProvider(); | |
| 62 | 60 |
| 63 base::FilePath exe_path; | 61 base::FilePath exe_path; |
| 64 PathService::Get(base::DIR_EXE, &exe_path); | 62 PathService::Get(base::DIR_EXE, &exe_path); |
| 65 | 63 |
| 66 #if defined(OS_MACOSX) && !defined(OS_IOS) | 64 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 67 // On Mac, a test Framework bundle is created that links locale.pak and | 65 // 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. | 66 // chrome_100_percent.pak at the appropriate places to ui_test.pak. |
| 69 base::mac::SetOverrideFrameworkBundlePath( | 67 base::mac::SetOverrideFrameworkBundlePath( |
| 70 exe_path.AppendASCII("ui_unittests Framework.framework")); | 68 exe_path.AppendASCII("ui_unittests Framework.framework")); |
| 71 ui::ResourceBundle::InitSharedInstanceWithLocale( | 69 ui::ResourceBundle::InitSharedInstanceWithLocale( |
| (...skipping 30 matching lines...) Expand all Loading... |
| 102 } // namespace | 100 } // namespace |
| 103 | 101 |
| 104 int main(int argc, char** argv) { | 102 int main(int argc, char** argv) { |
| 105 UIBaseTestSuite test_suite(argc, argv); | 103 UIBaseTestSuite test_suite(argc, argv); |
| 106 | 104 |
| 107 return base::LaunchUnitTests(argc, | 105 return base::LaunchUnitTests(argc, |
| 108 argv, | 106 argv, |
| 109 base::Bind(&UIBaseTestSuite::Run, | 107 base::Bind(&UIBaseTestSuite::Run, |
| 110 base::Unretained(&test_suite))); | 108 base::Unretained(&test_suite))); |
| 111 } | 109 } |
| OLD | NEW |