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