| 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 <memory> |
| 6 |
| 7 #include "base/bind.h" |
| 8 #include "base/macros.h" |
| 9 #include "base/sys_info.h" |
| 10 #include "chromecast/app/cast_main_delegate.h" |
| 11 #include "chromecast/base/cast_paths.h" |
| 12 #include "content/public/test/content_test_suite_base.h" |
| 13 #include "content/public/test/test_launcher.h" |
| 14 #include "ipc/ipc_channel.h" |
| 15 #include "mojo/edk/embedder/embedder.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 |
| 18 namespace chromecast { |
| 19 namespace shell { |
| 20 |
| 21 class CastTestLauncherDelegate : public content::TestLauncherDelegate { |
| 22 public: |
| 23 CastTestLauncherDelegate() {} |
| 24 ~CastTestLauncherDelegate() override {} |
| 25 |
| 26 int RunTestSuite(int argc, char** argv) override { |
| 27 return base::TestSuite(argc, argv).Run(); |
| 28 } |
| 29 |
| 30 bool AdjustChildProcessCommandLine( |
| 31 base::CommandLine* command_line, |
| 32 const base::FilePath& temp_data_dir) override { |
| 33 return true; |
| 34 } |
| 35 |
| 36 protected: |
| 37 content::ContentMainDelegate* CreateContentMainDelegate() override { |
| 38 return new CastMainDelegate(); |
| 39 } |
| 40 |
| 41 private: |
| 42 DISALLOW_COPY_AND_ASSIGN(CastTestLauncherDelegate); |
| 43 }; |
| 44 |
| 45 } // namespace shell |
| 46 } // namespace chromecast |
| 47 |
| 48 int main(int argc, char** argv) { |
| 49 int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); |
| 50 chromecast::shell::CastTestLauncherDelegate launcher_delegate; |
| 51 chromecast::RegisterPathProvider(); |
| 52 mojo::edk::SetMaxMessageSize(IPC::Channel::kMaximumMessageSize); |
| 53 mojo::edk::Init(); |
| 54 return LaunchTests(&launcher_delegate, default_jobs, argc, argv); |
| 55 } |
| OLD | NEW |