Chromium Code Reviews| 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 "blimp/engine/app/blimp_content_main_delegate.h" | |
| 11 #include "content/public/test/content_test_suite_base.h" | |
| 12 #include "content/public/test/test_launcher.h" | |
| 13 #include "testing/gtest/include/gtest/gtest.h" | |
| 14 | |
| 15 namespace blimp { | |
| 16 namespace { | |
| 17 | |
|
Kevin M
2016/05/05 20:28:51
Create a TestBlimpContentMainDelegate, which subcl
haibinlu
2016/05/05 22:41:36
Done.
| |
| 18 class BlimpTestLauncherDelegate : public content::TestLauncherDelegate { | |
| 19 public: | |
| 20 BlimpTestLauncherDelegate() {} | |
| 21 ~BlimpTestLauncherDelegate() override {} | |
| 22 | |
| 23 // content::TestLauncherDelegate implementation. | |
| 24 int RunTestSuite(int argc, char** argv) override { | |
| 25 return base::TestSuite(argc, argv).Run(); | |
| 26 } | |
| 27 | |
| 28 bool AdjustChildProcessCommandLine( | |
| 29 base::CommandLine* command_line, | |
| 30 const base::FilePath& temp_data_dir) override { | |
| 31 return true; | |
| 32 } | |
| 33 | |
| 34 protected: | |
| 35 content::ContentMainDelegate* CreateContentMainDelegate() override { | |
|
Kevin M
2016/05/05 20:28:52
Why is this protected and other overrides public?
haibinlu
2016/05/05 22:41:36
moved it to public.
| |
| 36 return new engine::BlimpContentMainDelegate(); | |
| 37 } | |
| 38 | |
| 39 private: | |
| 40 DISALLOW_COPY_AND_ASSIGN(BlimpTestLauncherDelegate); | |
| 41 }; | |
| 42 | |
| 43 } // namespace | |
| 44 } // namespace blimp | |
| 45 | |
| 46 int main(int argc, char** argv) { | |
| 47 int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); | |
| 48 blimp::BlimpTestLauncherDelegate launcher_delegate; | |
| 49 return LaunchTests(&launcher_delegate, default_jobs, argc, argv); | |
| 50 } | |
| OLD | NEW |