OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/macros.h" | 6 #include "base/macros.h" |
7 #include "base/sys_info.h" | 7 #include "base/sys_info.h" |
8 #include "content/public/test/content_test_suite_base.h" | 8 #include "content/public/test/content_test_suite_base.h" |
9 #include "content/public/test/test_launcher.h" | 9 #include "content/public/test/test_launcher.h" |
10 #include "headless/lib/browser/headless_browser_impl.h" | 10 #include "headless/lib/browser/headless_browser_impl.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 } | 38 } |
39 | 39 |
40 bool AdjustChildProcessCommandLine( | 40 bool AdjustChildProcessCommandLine( |
41 base::CommandLine* command_line, | 41 base::CommandLine* command_line, |
42 const base::FilePath& temp_data_dir) override { | 42 const base::FilePath& temp_data_dir) override { |
43 return true; | 43 return true; |
44 } | 44 } |
45 | 45 |
46 protected: | 46 protected: |
47 content::ContentMainDelegate* CreateContentMainDelegate() override { | 47 content::ContentMainDelegate* CreateContentMainDelegate() override { |
48 // TODO(skyostil): Add a way to test custom options. | 48 // Use HeadlessBrowserTest::SetBrowserOptions to override these defaults. |
49 HeadlessBrowser::Options::Builder options_builder(0, nullptr); | 49 HeadlessBrowser::Options::Builder options_builder; |
50 scoped_ptr<HeadlessBrowserImpl> browser( | 50 scoped_ptr<HeadlessBrowserImpl> browser( |
51 new HeadlessBrowserImplForTest(options_builder.Build())); | 51 new HeadlessBrowserImplForTest(options_builder.Build())); |
52 return new HeadlessContentMainDelegate(std::move(browser)); | 52 return new HeadlessContentMainDelegate(std::move(browser)); |
53 } | 53 } |
54 | 54 |
55 private: | 55 private: |
56 DISALLOW_COPY_AND_ASSIGN(HeadlessTestLauncherDelegate); | 56 DISALLOW_COPY_AND_ASSIGN(HeadlessTestLauncherDelegate); |
57 }; | 57 }; |
58 | 58 |
59 } // namespace | 59 } // namespace |
60 } // namespace headless | 60 } // namespace headless |
61 | 61 |
62 int main(int argc, char** argv) { | 62 int main(int argc, char** argv) { |
63 int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); | 63 int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); |
64 headless::HeadlessTestLauncherDelegate launcher_delegate; | 64 headless::HeadlessTestLauncherDelegate launcher_delegate; |
65 return LaunchTests(&launcher_delegate, default_jobs, argc, argv); | 65 return LaunchTests(&launcher_delegate, default_jobs, argc, argv); |
66 } | 66 } |
OLD | NEW |