| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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" | |
| 7 #include "base/macros.h" | 6 #include "base/macros.h" |
| 8 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 9 #include "base/test/launcher/unit_test_launcher.h" | 8 #include "base/test/launcher/unit_test_launcher.h" |
| 10 #include "base/test/test_suite.h" | 9 #include "base/test/test_suite.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 12 #include "ui/base/resource/resource_bundle.h" | 11 #include "ui/base/resource/resource_bundle.h" |
| 13 #include "ui/base/ui_base_paths.h" | 12 #include "ui/base/ui_base_paths.h" |
| 14 #include "ui/gl/test/gl_surface_test_support.h" | 13 #include "ui/gl/test/gl_surface_test_support.h" |
| 15 | 14 |
| 16 namespace { | 15 namespace { |
| 17 | 16 |
| 18 class KeyboardTestSuite : public base::TestSuite { | 17 class AppListShowerTestSuite : public base::TestSuite { |
| 19 public: | 18 public: |
| 20 KeyboardTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} | 19 AppListShowerTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} |
| 21 | 20 |
| 22 protected: | 21 protected: |
| 23 void Initialize() override { | 22 void Initialize() override { |
| 23 gfx::GLSurfaceTestSupport::InitializeOneOff(); |
| 24 base::TestSuite::Initialize(); | 24 base::TestSuite::Initialize(); |
| 25 gfx::GLSurfaceTestSupport::InitializeOneOff(); | |
| 26 ui::RegisterPathProvider(); | 25 ui::RegisterPathProvider(); |
| 27 | 26 |
| 28 base::FilePath ui_test_pak_path; | 27 base::FilePath ui_test_pak_path; |
| 29 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); | 28 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); |
| 30 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); | 29 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); |
| 31 } | 30 } |
| 32 | 31 |
| 33 void Shutdown() override { | 32 void Shutdown() override { |
| 34 ui::ResourceBundle::CleanupSharedInstance(); | 33 ui::ResourceBundle::CleanupSharedInstance(); |
| 35 base::TestSuite::Shutdown(); | 34 base::TestSuite::Shutdown(); |
| 36 } | 35 } |
| 37 | 36 |
| 38 private: | 37 private: |
| 39 DISALLOW_COPY_AND_ASSIGN(KeyboardTestSuite); | 38 DISALLOW_COPY_AND_ASSIGN(AppListShowerTestSuite); |
| 40 }; | 39 }; |
| 41 | 40 |
| 42 } // namespace | 41 } // namespace |
| 43 | 42 |
| 44 int main(int argc, char** argv) { | 43 int main(int argc, char** argv) { |
| 45 KeyboardTestSuite test_suite(argc, argv); | 44 AppListShowerTestSuite test_suite(argc, argv); |
| 46 | 45 |
| 47 return base::LaunchUnitTests( | 46 return base::LaunchUnitTests( |
| 48 argc, | 47 argc, argv, |
| 49 argv, | 48 base::Bind(&AppListShowerTestSuite::Run, base::Unretained(&test_suite))); |
| 50 base::Bind(&KeyboardTestSuite::Run, base::Unretained(&test_suite))); | |
| 51 } | 49 } |
| OLD | NEW |