OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/public/test/test_launcher.h" | 5 #include "content/public/test/test_launcher.h" |
6 | 6 |
7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/stack_trace.h" | 9 #include "base/debug/stack_trace.h" |
10 #include "base/i18n/icu_util.h" | 10 #include "base/i18n/icu_util.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 class ContentTestLauncherDelegate : public TestLauncherDelegate { | 96 class ContentTestLauncherDelegate : public TestLauncherDelegate { |
97 public: | 97 public: |
98 ContentTestLauncherDelegate() {} | 98 ContentTestLauncherDelegate() {} |
99 ~ContentTestLauncherDelegate() override {} | 99 ~ContentTestLauncherDelegate() override {} |
100 | 100 |
101 int RunTestSuite(int argc, char** argv) override { | 101 int RunTestSuite(int argc, char** argv) override { |
102 return ContentBrowserTestSuite(argc, argv).Run(); | 102 return ContentBrowserTestSuite(argc, argv).Run(); |
103 } | 103 } |
104 | 104 |
105 bool AdjustChildProcessCommandLine( | 105 bool AdjustChildProcessCommandLine( |
106 CommandLine* command_line, | 106 base::CommandLine* command_line, |
107 const base::FilePath& temp_data_dir) override { | 107 const base::FilePath& temp_data_dir) override { |
108 command_line->AppendSwitchPath(switches::kContentShellDataPath, | 108 command_line->AppendSwitchPath(switches::kContentShellDataPath, |
109 temp_data_dir); | 109 temp_data_dir); |
110 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); | 110 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); |
111 command_line->AppendSwitch(switches::kUseFakeUIForMediaStream); | 111 command_line->AppendSwitch(switches::kUseFakeUIForMediaStream); |
112 return true; | 112 return true; |
113 } | 113 } |
114 | 114 |
115 protected: | 115 protected: |
116 ContentMainDelegate* CreateContentMainDelegate() override { | 116 ContentMainDelegate* CreateContentMainDelegate() override { |
117 return new ShellMainDelegate(); | 117 return new ShellMainDelegate(); |
118 } | 118 } |
119 | 119 |
120 private: | 120 private: |
121 DISALLOW_COPY_AND_ASSIGN(ContentTestLauncherDelegate); | 121 DISALLOW_COPY_AND_ASSIGN(ContentTestLauncherDelegate); |
122 }; | 122 }; |
123 | 123 |
124 } // namespace content | 124 } // namespace content |
125 | 125 |
126 int main(int argc, char** argv) { | 126 int main(int argc, char** argv) { |
127 int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); | 127 int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); |
128 content::ContentTestLauncherDelegate launcher_delegate; | 128 content::ContentTestLauncherDelegate launcher_delegate; |
129 return LaunchTests(&launcher_delegate, default_jobs, argc, argv); | 129 return LaunchTests(&launcher_delegate, default_jobs, argc, argv); |
130 } | 130 } |
OLD | NEW |