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