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