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 <memory> | 5 #include <memory> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
10 #include "content/public/test/content_test_suite_base.h" | 10 #include "content/public/test/content_test_suite_base.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 } | 40 } |
41 | 41 |
42 bool AdjustChildProcessCommandLine( | 42 bool AdjustChildProcessCommandLine( |
43 base::CommandLine* command_line, | 43 base::CommandLine* command_line, |
44 const base::FilePath& temp_data_dir) override { | 44 const base::FilePath& temp_data_dir) override { |
45 return true; | 45 return true; |
46 } | 46 } |
47 | 47 |
48 protected: | 48 protected: |
49 content::ContentMainDelegate* CreateContentMainDelegate() override { | 49 content::ContentMainDelegate* CreateContentMainDelegate() override { |
50 // Use HeadlessBrowserTest::SetBrowserOptions to override these defaults. | 50 // Use HeadlessBrowserTest::options() or HeadlessBrowserContextOptions to |
| 51 // modify these defaults. |
51 HeadlessBrowser::Options::Builder options_builder; | 52 HeadlessBrowser::Options::Builder options_builder; |
52 std::unique_ptr<HeadlessBrowserImpl> browser( | 53 std::unique_ptr<HeadlessBrowserImpl> browser( |
53 new HeadlessBrowserImplForTest(options_builder.Build())); | 54 new HeadlessBrowserImplForTest(options_builder.Build())); |
54 return new HeadlessContentMainDelegate(std::move(browser)); | 55 return new HeadlessContentMainDelegate(std::move(browser)); |
55 } | 56 } |
56 | 57 |
57 private: | 58 private: |
58 DISALLOW_COPY_AND_ASSIGN(HeadlessTestLauncherDelegate); | 59 DISALLOW_COPY_AND_ASSIGN(HeadlessTestLauncherDelegate); |
59 }; | 60 }; |
60 | 61 |
61 } // namespace | 62 } // namespace |
62 } // namespace headless | 63 } // namespace headless |
63 | 64 |
64 int main(int argc, char** argv) { | 65 int main(int argc, char** argv) { |
65 int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); | 66 int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); |
66 headless::HeadlessTestLauncherDelegate launcher_delegate; | 67 headless::HeadlessTestLauncherDelegate launcher_delegate; |
67 return LaunchTests(&launcher_delegate, default_jobs, argc, argv); | 68 return LaunchTests(&launcher_delegate, default_jobs, argc, argv); |
68 } | 69 } |
OLD | NEW |