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 "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/gl_surface.h" | |
15 | 13 |
16 namespace { | 14 namespace { |
17 | 15 |
18 class KeyboardTestSuite : public base::TestSuite { | 16 class GfxTestSuite : public base::TestSuite { |
19 public: | 17 public: |
20 KeyboardTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} | 18 GfxTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} |
21 | 19 |
22 protected: | 20 protected: |
23 virtual void Initialize() OVERRIDE { | 21 virtual void Initialize() OVERRIDE { |
24 base::TestSuite::Initialize(); | 22 base::TestSuite::Initialize(); |
25 gfx::GLSurface::InitializeOneOffForTests(); | |
26 ui::RegisterPathProvider(); | 23 ui::RegisterPathProvider(); |
27 | 24 |
28 base::FilePath ui_test_pak_path; | 25 base::FilePath pak_dir; |
29 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); | 26 PathService::Get(base::DIR_MODULE, &pak_dir); |
30 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); | 27 |
| 28 base::FilePath pak_file; |
| 29 pak_file = pak_dir.Append(FILE_PATH_LITERAL("ui_test.pak")); |
| 30 |
| 31 ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file); |
31 } | 32 } |
32 | 33 |
33 virtual void Shutdown() OVERRIDE { | 34 virtual void Shutdown() OVERRIDE { |
34 ui::ResourceBundle::CleanupSharedInstance(); | 35 ui::ResourceBundle::CleanupSharedInstance(); |
35 base::TestSuite::Shutdown(); | 36 base::TestSuite::Shutdown(); |
36 } | 37 } |
37 | 38 |
38 private: | 39 private: |
39 DISALLOW_COPY_AND_ASSIGN(KeyboardTestSuite); | 40 DISALLOW_COPY_AND_ASSIGN(GfxTestSuite); |
40 }; | 41 }; |
41 | 42 |
42 } // namespace | 43 } // namespace |
43 | 44 |
44 int main(int argc, char** argv) { | 45 int main(int argc, char** argv) { |
45 KeyboardTestSuite test_suite(argc, argv); | 46 GfxTestSuite test_suite(argc, argv); |
46 | 47 |
47 return base::LaunchUnitTests( | 48 return base::LaunchUnitTests( |
48 argc, | 49 argc, |
49 argv, | 50 argv, |
50 base::Bind(&KeyboardTestSuite::Run, base::Unretained(&test_suite))); | 51 base::Bind(&GfxTestSuite::Run, base::Unretained(&test_suite))); |
51 } | 52 } |
OLD | NEW |