| 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/compiler_specific.h" | 6 #include "base/compiler_specific.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 "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 12 |
| 13 #if defined(OS_ANDROID) | 13 #if defined(OS_ANDROID) |
| 14 #include "base/android/jni_android.h" | 14 #include "base/android/jni_android.h" |
| 15 #include "ui/gfx/android/gfx_jni_registrar.h" | 15 #include "ui/gfx/android/gfx_jni_registrar.h" |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 #if defined(OS_MACOSX) && !defined(OS_IOS) | |
| 19 #include "base/test/mock_chrome_application_mac.h" | |
| 20 #endif | |
| 21 | |
| 22 namespace { | 18 namespace { |
| 23 | 19 |
| 24 class GfxTestSuite : public base::TestSuite { | 20 class GfxTestSuite : public base::TestSuite { |
| 25 public: | 21 public: |
| 26 GfxTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} | 22 GfxTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} |
| 27 | 23 |
| 28 protected: | 24 protected: |
| 29 void Initialize() override { | 25 void Initialize() override { |
| 30 base::TestSuite::Initialize(); | 26 base::TestSuite::Initialize(); |
| 31 | 27 |
| 32 #if defined(OS_ANDROID) | 28 #if defined(OS_ANDROID) |
| 33 gfx::android::RegisterJni(base::android::AttachCurrentThread()); | 29 gfx::android::RegisterJni(base::android::AttachCurrentThread()); |
| 34 #endif | 30 #endif |
| 35 | |
| 36 #if defined(OS_MACOSX) && !defined(OS_IOS) | |
| 37 mock_cr_app::RegisterMockCrApp(); | |
| 38 #endif | |
| 39 } | 31 } |
| 40 | 32 |
| 41 void Shutdown() override { | 33 void Shutdown() override { |
| 42 base::TestSuite::Shutdown(); | 34 base::TestSuite::Shutdown(); |
| 43 } | 35 } |
| 44 | 36 |
| 45 private: | 37 private: |
| 46 DISALLOW_COPY_AND_ASSIGN(GfxTestSuite); | 38 DISALLOW_COPY_AND_ASSIGN(GfxTestSuite); |
| 47 }; | 39 }; |
| 48 | 40 |
| 49 } // namespace | 41 } // namespace |
| 50 | 42 |
| 51 int main(int argc, char** argv) { | 43 int main(int argc, char** argv) { |
| 52 GfxTestSuite test_suite(argc, argv); | 44 GfxTestSuite test_suite(argc, argv); |
| 53 | 45 |
| 54 return base::LaunchUnitTests( | 46 return base::LaunchUnitTests( |
| 55 argc, | 47 argc, |
| 56 argv, | 48 argv, |
| 57 base::Bind(&GfxTestSuite::Run, base::Unretained(&test_suite))); | 49 base::Bind(&GfxTestSuite::Run, base::Unretained(&test_suite))); |
| 58 } | 50 } |
| OLD | NEW |