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

Side by Side Diff: chromecast/shell/browser/test/chromecast_browser_test_runner.cc

Issue 518773003: Chromecast: end-to-end browser test based on content::BrowserTest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cast-browser-process
Patch Set: Created 6 years, 3 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
OLDNEW
(Empty)
1 // Copyright 2014 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 "base/command_line.h"
6 #include "base/macros.h"
7 #include "base/sys_info.h"
8 #include "chromecast/shell/app/cast_main_delegate.h"
9 #include "content/public/common/content_switches.h"
10 #include "content/public/test/content_test_suite_base.h"
11 #include "content/public/test/test_launcher.h"
12 #include "testing/gtest/include/gtest/gtest.h"
13
14 namespace chromecast {
15 namespace shell {
16
17 namespace {
18
19 const char kTestTypeBrowser[] = "browser";
20
21 class BrowserTestSuite : public content::ContentTestSuiteBase {
22 public:
23 BrowserTestSuite(int argc, char** argv)
24 : content::ContentTestSuiteBase(argc, argv) {
25 }
26 virtual ~BrowserTestSuite() {
27 }
28
29 private:
30 DISALLOW_COPY_AND_ASSIGN(BrowserTestSuite);
31 };
32
33 } // namespace
34
35 class ChromecastTestLauncherDelegate : public content::TestLauncherDelegate {
byungchul 2014/08/30 00:19:00 Why not defined in anonymous namespace?
gunsch 2014/08/30 15:28:43 Done.
36 public:
37 ChromecastTestLauncherDelegate() {}
38 virtual ~ChromecastTestLauncherDelegate() {}
39
40 virtual int RunTestSuite(int argc, char** argv) OVERRIDE {
41 return BrowserTestSuite(argc, argv).Run();
42 }
43
44 virtual bool AdjustChildProcessCommandLine(
45 base::CommandLine* command_line,
46 const base::FilePath& temp_data_dir) OVERRIDE {
47 // TODO(gunsch): handle temp_data_dir
48 command_line->AppendSwitchASCII(switches::kTestType, kTestTypeBrowser);
49 return true;
50 }
51
52 protected:
53 virtual content::ContentMainDelegate* CreateContentMainDelegate() OVERRIDE {
54 return new CastMainDelegate();
55 }
56
57 private:
58 DISALLOW_COPY_AND_ASSIGN(ChromecastTestLauncherDelegate);
59 };
60
61 } // namespace shell
62 } // namespace chromecast
63
64 int main(int argc, char** argv) {
65 int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2);
66 chromecast::shell::ChromecastTestLauncherDelegate launcher_delegate;
67 return LaunchTests(&launcher_delegate, default_jobs, argc, argv);
68 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698