Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Side by Side Diff: headless/test/headless_test_launcher.cc

Issue 2013483002: headless: Make HeadlessBrowser::Options move-only (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « headless/test/headless_browser_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "content/public/test/test_launcher.h" 11 #include "content/public/test/test_launcher.h"
12 #include "headless/lib/browser/headless_browser_impl.h" 12 #include "headless/lib/browser/headless_browser_impl.h"
13 #include "headless/lib/headless_content_main_delegate.h" 13 #include "headless/lib/headless_content_main_delegate.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 15
16 namespace headless { 16 namespace headless {
17 namespace { 17 namespace {
18 18
19 class HeadlessBrowserImplForTest : public HeadlessBrowserImpl { 19 class HeadlessBrowserImplForTest : public HeadlessBrowserImpl {
20 public: 20 public:
21 explicit HeadlessBrowserImplForTest(const HeadlessBrowser::Options& options) 21 explicit HeadlessBrowserImplForTest(HeadlessBrowser::Options options)
22 : HeadlessBrowserImpl(base::Bind(&HeadlessBrowserImplForTest::OnStart, 22 : HeadlessBrowserImpl(base::Bind(&HeadlessBrowserImplForTest::OnStart,
23 base::Unretained(this)), 23 base::Unretained(this)),
24 options) {} 24 std::move(options)) {}
25 25
26 void OnStart(HeadlessBrowser* browser) { EXPECT_EQ(this, browser); } 26 void OnStart(HeadlessBrowser* browser) { EXPECT_EQ(this, browser); }
27 27
28 private: 28 private:
29 DISALLOW_COPY_AND_ASSIGN(HeadlessBrowserImplForTest); 29 DISALLOW_COPY_AND_ASSIGN(HeadlessBrowserImplForTest);
30 }; 30 };
31 31
32 class HeadlessTestLauncherDelegate : public content::TestLauncherDelegate { 32 class HeadlessTestLauncherDelegate : public content::TestLauncherDelegate {
33 public: 33 public:
34 HeadlessTestLauncherDelegate() {} 34 HeadlessTestLauncherDelegate() {}
(...skipping 24 matching lines...) Expand all
59 }; 59 };
60 60
61 } // namespace 61 } // namespace
62 } // namespace headless 62 } // namespace headless
63 63
64 int main(int argc, char** argv) { 64 int main(int argc, char** argv) {
65 int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); 65 int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2);
66 headless::HeadlessTestLauncherDelegate launcher_delegate; 66 headless::HeadlessTestLauncherDelegate launcher_delegate;
67 return LaunchTests(&launcher_delegate, default_jobs, argc, argv); 67 return LaunchTests(&launcher_delegate, default_jobs, argc, argv);
68 } 68 }
OLDNEW
« no previous file with comments | « headless/test/headless_browser_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698