OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/bind.h" |
| 6 #include "base/files/file_util.h" |
| 7 #include "base/path_service.h" |
| 8 #include "base/test/launcher/unit_test_launcher.h" |
| 9 #include "base/test/test_suite.h" |
| 10 #include "ui/base/resource/resource_bundle.h" |
| 11 #include "ui/base/ui_base_paths.h" |
| 12 |
| 13 namespace { |
| 14 |
| 15 class VrCommonTestSuite : public base::TestSuite { |
| 16 public: |
| 17 VrCommonTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} |
| 18 |
| 19 protected: |
| 20 void Initialize() override { |
| 21 base::TestSuite::Initialize(); |
| 22 |
| 23 ui::RegisterPathProvider(); |
| 24 |
| 25 base::FilePath pak_path; |
| 26 #if defined(OS_ANDROID) |
| 27 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &pak_path); |
| 28 #else |
| 29 PathService::Get(base::DIR_MODULE, &pak_path); |
| 30 #endif |
| 31 ui::ResourceBundle::InitSharedInstanceWithPakPath( |
| 32 pak_path.AppendASCII("components_tests_resources.pak")); |
| 33 } |
| 34 |
| 35 void Shutdown() override { |
| 36 ui::ResourceBundle::CleanupSharedInstance(); |
| 37 base::TestSuite::Shutdown(); |
| 38 } |
| 39 |
| 40 private: |
| 41 DISALLOW_COPY_AND_ASSIGN(VrCommonTestSuite); |
| 42 }; |
| 43 |
| 44 } // namespace |
| 45 |
| 46 int main(int argc, char** argv) { |
| 47 VrCommonTestSuite test_suite(argc, argv); |
| 48 |
| 49 return base::LaunchUnitTests( |
| 50 argc, argv, |
| 51 base::Bind(&VrCommonTestSuite::Run, base::Unretained(&test_suite))); |
| 52 } |
OLD | NEW |