| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/macros.h" | 6 #include "base/macros.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 "testing/gtest/include/gtest/gtest.h" | 10 #include "services/service_manager/public/cpp/test/common_initialization.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 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 class DisplayServiceTestSuite : public base::TestSuite { | 16 class ServiceTestSuite : public base::TestSuite { |
| 17 public: | 17 public: |
| 18 DisplayServiceTestSuite(int argc, char** argv) | 18 ServiceTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} |
| 19 : base::TestSuite(argc, argv) {} | 19 ~ServiceTestSuite() override {} |
| 20 ~DisplayServiceTestSuite() override {} | |
| 21 | 20 |
| 22 protected: | 21 protected: |
| 23 void Initialize() override { | 22 void Initialize() override { |
| 24 base::TestSuite::Initialize(); | 23 base::TestSuite::Initialize(); |
| 25 ui::RegisterPathProvider(); | 24 ui::RegisterPathProvider(); |
| 26 | 25 |
| 27 base::FilePath ui_test_pak_path; | 26 base::FilePath ui_test_pak_path; |
| 28 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); | 27 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); |
| 29 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); | 28 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); |
| 30 } | 29 } |
| 31 | 30 |
| 32 void Shutdown() override { | 31 void Shutdown() override { |
| 33 ui::ResourceBundle::CleanupSharedInstance(); | 32 ui::ResourceBundle::CleanupSharedInstance(); |
| 34 base::TestSuite::Shutdown(); | 33 base::TestSuite::Shutdown(); |
| 35 } | 34 } |
| 36 | 35 |
| 37 private: | 36 private: |
| 38 DISALLOW_COPY_AND_ASSIGN(DisplayServiceTestSuite); | 37 DISALLOW_COPY_AND_ASSIGN(ServiceTestSuite); |
| 39 }; | 38 }; |
| 40 | 39 |
| 41 } // namespace | 40 } // namespace |
| 42 | 41 |
| 43 int main(int argc, char** argv) { | 42 int main(int argc, char** argv) { |
| 44 DisplayServiceTestSuite test_suite(argc, argv); | 43 ServiceTestSuite test_suite(argc, argv); |
| 45 | 44 |
| 46 return base::LaunchUnitTests( | 45 return service_manager::InitializeAndLaunchUnitTests( |
| 47 argc, argv, | 46 argc, argv, |
| 48 base::Bind(&DisplayServiceTestSuite::Run, base::Unretained(&test_suite))); | 47 base::Bind(&ServiceTestSuite::Run, base::Unretained(&test_suite))); |
| 49 } | 48 } |
| OLD | NEW |