| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "base/macros.h" | |
| 6 #include "base/sys_info.h" | |
| 7 #include "base/test/test_suite.h" | |
| 8 #include "chromecast/app/cast_main_delegate.h" | |
| 9 #include "content/public/test/test_launcher.h" | |
| 10 | |
| 11 namespace chromecast { | |
| 12 namespace shell { | |
| 13 | |
| 14 class CastTestLauncherDelegate : public content::TestLauncherDelegate { | |
| 15 public: | |
| 16 CastTestLauncherDelegate() {} | |
| 17 ~CastTestLauncherDelegate() override {} | |
| 18 | |
| 19 int RunTestSuite(int argc, char** argv) override { | |
| 20 return base::TestSuite(argc, argv).Run(); | |
| 21 } | |
| 22 | |
| 23 bool AdjustChildProcessCommandLine( | |
| 24 base::CommandLine* command_line, | |
| 25 const base::FilePath& temp_data_dir) override { | |
| 26 return true; | |
| 27 } | |
| 28 | |
| 29 protected: | |
| 30 content::ContentMainDelegate* CreateContentMainDelegate() override { | |
| 31 return new CastMainDelegate(); | |
| 32 } | |
| 33 | |
| 34 private: | |
| 35 DISALLOW_COPY_AND_ASSIGN(CastTestLauncherDelegate); | |
| 36 }; | |
| 37 | |
| 38 } // namespace shell | |
| 39 } // namespace chromecast | |
| 40 | |
| 41 int main(int argc, char** argv) { | |
| 42 int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); | |
| 43 chromecast::shell::CastTestLauncherDelegate launcher_delegate; | |
| 44 return content::LaunchTests(&launcher_delegate, default_jobs, argc, argv); | |
| 45 } | |
| OLD | NEW |