| 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" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "base/test/mock_chrome_application_mac.h" | 21 #include "base/test/mock_chrome_application_mac.h" |
| 22 #endif | 22 #endif |
| 23 | 23 |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 class GfxTestSuite : public base::TestSuite { | 26 class GfxTestSuite : public base::TestSuite { |
| 27 public: | 27 public: |
| 28 GfxTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} | 28 GfxTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} |
| 29 | 29 |
| 30 protected: | 30 protected: |
| 31 virtual void Initialize() override { | 31 void Initialize() override { |
| 32 base::TestSuite::Initialize(); | 32 base::TestSuite::Initialize(); |
| 33 | 33 |
| 34 #if defined(OS_ANDROID) | 34 #if defined(OS_ANDROID) |
| 35 gfx::android::RegisterJni(base::android::AttachCurrentThread()); | 35 gfx::android::RegisterJni(base::android::AttachCurrentThread()); |
| 36 #endif | 36 #endif |
| 37 | 37 |
| 38 #if defined(OS_MACOSX) && !defined(OS_IOS) | 38 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 39 mock_cr_app::RegisterMockCrApp(); | 39 mock_cr_app::RegisterMockCrApp(); |
| 40 #endif | 40 #endif |
| 41 | 41 |
| 42 ui::RegisterPathProvider(); | 42 ui::RegisterPathProvider(); |
| 43 | 43 |
| 44 base::FilePath ui_test_pak_path; | 44 base::FilePath ui_test_pak_path; |
| 45 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); | 45 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); |
| 46 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); | 46 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); |
| 47 } | 47 } |
| 48 | 48 |
| 49 virtual void Shutdown() override { | 49 void Shutdown() override { |
| 50 ui::ResourceBundle::CleanupSharedInstance(); | 50 ui::ResourceBundle::CleanupSharedInstance(); |
| 51 base::TestSuite::Shutdown(); | 51 base::TestSuite::Shutdown(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 DISALLOW_COPY_AND_ASSIGN(GfxTestSuite); | 55 DISALLOW_COPY_AND_ASSIGN(GfxTestSuite); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 } // namespace | 58 } // namespace |
| 59 | 59 |
| 60 int main(int argc, char** argv) { | 60 int main(int argc, char** argv) { |
| 61 GfxTestSuite test_suite(argc, argv); | 61 GfxTestSuite test_suite(argc, argv); |
| 62 | 62 |
| 63 return base::LaunchUnitTests( | 63 return base::LaunchUnitTests( |
| 64 argc, | 64 argc, |
| 65 argv, | 65 argv, |
| 66 base::Bind(&GfxTestSuite::Run, base::Unretained(&test_suite))); | 66 base::Bind(&GfxTestSuite::Run, base::Unretained(&test_suite))); |
| 67 } | 67 } |
| OLD | NEW |