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