| 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/dpi.h" |
| 13 | 14 |
| 14 #if defined(OS_ANDROID) | 15 #if defined(OS_ANDROID) |
| 15 #include "base/android/jni_android.h" | 16 #include "base/android/jni_android.h" |
| 16 #include "ui/base/android/ui_base_jni_registrar.h" | 17 #include "ui/base/android/ui_base_jni_registrar.h" |
| 17 #include "ui/gfx/android/gfx_jni_registrar.h" | 18 #include "ui/gfx/android/gfx_jni_registrar.h" |
| 18 #endif | 19 #endif |
| 19 | 20 |
| 20 #if defined(OS_MACOSX) && !defined(OS_IOS) | 21 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 21 #include "base/mac/bundle_locations.h" | 22 #include "base/mac/bundle_locations.h" |
| 22 #include "base/test/mock_chrome_application_mac.h" | 23 #include "base/test/mock_chrome_application_mac.h" |
| 23 #endif | 24 #endif |
| 24 | 25 |
| 25 #if defined(OS_WIN) | |
| 26 #include "ui/gfx/win/dpi.h" | |
| 27 #endif | |
| 28 | |
| 29 namespace { | 26 namespace { |
| 30 | 27 |
| 31 class UIBaseTestSuite : public base::TestSuite { | 28 class UIBaseTestSuite : public base::TestSuite { |
| 32 public: | 29 public: |
| 33 UIBaseTestSuite(int argc, char** argv); | 30 UIBaseTestSuite(int argc, char** argv); |
| 34 | 31 |
| 35 protected: | 32 protected: |
| 36 // base::TestSuite: | 33 // base::TestSuite: |
| 37 void Initialize() override; | 34 void Initialize() override; |
| 38 void Shutdown() override; | 35 void Shutdown() override; |
| 39 | 36 |
| 40 private: | 37 private: |
| 41 DISALLOW_COPY_AND_ASSIGN(UIBaseTestSuite); | 38 DISALLOW_COPY_AND_ASSIGN(UIBaseTestSuite); |
| 42 }; | 39 }; |
| 43 | 40 |
| 44 UIBaseTestSuite::UIBaseTestSuite(int argc, char** argv) | 41 UIBaseTestSuite::UIBaseTestSuite(int argc, char** argv) |
| 45 : base::TestSuite(argc, argv) {} | 42 : base::TestSuite(argc, argv) {} |
| 46 | 43 |
| 47 void UIBaseTestSuite::Initialize() { | 44 void UIBaseTestSuite::Initialize() { |
| 48 base::TestSuite::Initialize(); | 45 base::TestSuite::Initialize(); |
| 49 | 46 |
| 50 #if defined(OS_WIN) | 47 #if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) |
| 51 gfx::ForceHighDPISupportForTesting(1.0); | 48 gfx::ForceHighDPISupportForTesting(1.0); |
| 52 #endif | 49 #endif |
| 53 | 50 |
| 54 #if defined(OS_ANDROID) | 51 #if defined(OS_ANDROID) |
| 55 // Register JNI bindings for android. | 52 // Register JNI bindings for android. |
| 56 gfx::android::RegisterJni(base::android::AttachCurrentThread()); | 53 gfx::android::RegisterJni(base::android::AttachCurrentThread()); |
| 57 ui::android::RegisterJni(base::android::AttachCurrentThread()); | 54 ui::android::RegisterJni(base::android::AttachCurrentThread()); |
| 58 #endif | 55 #endif |
| 59 | 56 |
| 60 ui::RegisterPathProvider(); | 57 ui::RegisterPathProvider(); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 } // namespace | 100 } // namespace |
| 104 | 101 |
| 105 int main(int argc, char** argv) { | 102 int main(int argc, char** argv) { |
| 106 UIBaseTestSuite test_suite(argc, argv); | 103 UIBaseTestSuite test_suite(argc, argv); |
| 107 | 104 |
| 108 return base::LaunchUnitTests(argc, | 105 return base::LaunchUnitTests(argc, |
| 109 argv, | 106 argv, |
| 110 base::Bind(&UIBaseTestSuite::Run, | 107 base::Bind(&UIBaseTestSuite::Run, |
| 111 base::Unretained(&test_suite))); | 108 base::Unretained(&test_suite))); |
| 112 } | 109 } |
| OLD | NEW |