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