Chromium Code Reviews| Index: blimp/test/blimp_test_launcher.cc |
| diff --git a/blimp/test/blimp_test_launcher.cc b/blimp/test/blimp_test_launcher.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..198bec60ffd1a3346d47650f96c9f87abd962e17 |
| --- /dev/null |
| +++ b/blimp/test/blimp_test_launcher.cc |
| @@ -0,0 +1,50 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include <memory> |
| + |
| +#include "base/bind.h" |
| +#include "base/macros.h" |
| +#include "base/sys_info.h" |
| +#include "blimp/engine/app/blimp_content_main_delegate.h" |
| +#include "content/public/test/content_test_suite_base.h" |
| +#include "content/public/test/test_launcher.h" |
| +#include "testing/gtest/include/gtest/gtest.h" |
| + |
| +namespace blimp { |
| +namespace { |
| + |
| +class BlimpTestLauncherDelegate : public content::TestLauncherDelegate { |
|
Kevin M
2016/05/02 21:32:40
If this is engine-specific, we should have an engi
haibinlu
2016/05/03 19:32:43
standard test launcher. It just happens to launch
|
| + public: |
| + BlimpTestLauncherDelegate() {} |
| + ~BlimpTestLauncherDelegate() override {} |
| + |
| + // content::TestLauncherDelegate implementation. |
| + int RunTestSuite(int argc, char** argv) override { |
| + return base::TestSuite(argc, argv).Run(); |
| + } |
| + |
| + bool AdjustChildProcessCommandLine( |
| + base::CommandLine* command_line, |
| + const base::FilePath& temp_data_dir) override { |
| + return true; |
| + } |
| + |
| + protected: |
| + content::ContentMainDelegate* CreateContentMainDelegate() override { |
| + return new engine::BlimpContentMainDelegate(); |
| + } |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(BlimpTestLauncherDelegate); |
| +}; |
| + |
| +} // namespace |
| +} // namespace blimp |
| + |
| +int main(int argc, char** argv) { |
| + int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); |
| + blimp::BlimpTestLauncherDelegate launcher_delegate; |
| + return LaunchTests(&launcher_delegate, default_jobs, argc, argv); |
| +} |