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" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.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 "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 #include "ui/gl/gl_surface.h" |
13 | 14 |
14 namespace { | 15 namespace { |
15 | 16 |
16 class KeyboardTestSuite : public base::TestSuite { | 17 class KeyboardTestSuite : public base::TestSuite { |
17 public: | 18 public: |
18 KeyboardTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} | 19 KeyboardTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} |
19 | 20 |
20 protected: | 21 protected: |
21 virtual void Initialize() OVERRIDE { | 22 virtual void Initialize() OVERRIDE { |
22 base::TestSuite::Initialize(); | 23 base::TestSuite::Initialize(); |
| 24 gfx::GLSurface::InitializeOneOffForTests(); |
23 ui::RegisterPathProvider(); | 25 ui::RegisterPathProvider(); |
24 | 26 |
25 base::FilePath pak_dir; | 27 base::FilePath pak_dir; |
26 PathService::Get(base::DIR_MODULE, &pak_dir); | 28 PathService::Get(base::DIR_MODULE, &pak_dir); |
27 | 29 |
28 base::FilePath pak_file; | 30 base::FilePath pak_file; |
29 pak_file = pak_dir.Append(FILE_PATH_LITERAL("ui_test.pak")); | 31 pak_file = pak_dir.Append(FILE_PATH_LITERAL("ui_test.pak")); |
30 | 32 |
31 ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file); | 33 ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file); |
32 } | 34 } |
(...skipping 10 matching lines...) Expand all Loading... |
43 } // namespace | 45 } // namespace |
44 | 46 |
45 int main(int argc, char** argv) { | 47 int main(int argc, char** argv) { |
46 KeyboardTestSuite test_suite(argc, argv); | 48 KeyboardTestSuite test_suite(argc, argv); |
47 | 49 |
48 return base::LaunchUnitTests( | 50 return base::LaunchUnitTests( |
49 argc, | 51 argc, |
50 argv, | 52 argv, |
51 base::Bind(&KeyboardTestSuite::Run, base::Unretained(&test_suite))); | 53 base::Bind(&KeyboardTestSuite::Run, base::Unretained(&test_suite))); |
52 } | 54 } |
OLD | NEW |