OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/files/file_enumerator.h" | 6 #include "base/files/file_enumerator.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/process/launch.h" | 8 #include "base/process/launch.h" |
9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 CommandLine command_line(CommandLine::NO_PROGRAM); | 90 CommandLine command_line(CommandLine::NO_PROGRAM); |
91 EXPECT_TRUE(GetPythonCommand(&command_line)); | 91 EXPECT_TRUE(GetPythonCommand(&command_line)); |
92 | 92 |
93 command_line.AppendArgPath(appengine_dev_appserver); | 93 command_line.AppendArgPath(appengine_dev_appserver); |
94 command_line.AppendArgPath(apprtc_dir); | 94 command_line.AppendArgPath(apprtc_dir); |
95 command_line.AppendArg("--port=9999"); | 95 command_line.AppendArg("--port=9999"); |
96 command_line.AppendArg("--admin_port=9998"); | 96 command_line.AppendArg("--admin_port=9998"); |
97 command_line.AppendArg("--skip_sdk_update_check"); | 97 command_line.AppendArg("--skip_sdk_update_check"); |
98 | 98 |
99 VLOG(1) << "Running " << command_line.GetCommandLineString(); | 99 DVLOG(1) << "Running " << command_line.GetCommandLineString(); |
100 return base::LaunchProcess(command_line, base::LaunchOptions(), | 100 return base::LaunchProcess(command_line, base::LaunchOptions(), |
101 &dev_appserver_); | 101 &dev_appserver_); |
102 } | 102 } |
103 | 103 |
104 bool LocalApprtcInstanceIsUp() { | 104 bool LocalApprtcInstanceIsUp() { |
105 // Load the admin page and see if we manage to load it right. | 105 // Load the admin page and see if we manage to load it right. |
106 ui_test_utils::NavigateToURL(browser(), GURL("localhost:9998")); | 106 ui_test_utils::NavigateToURL(browser(), GURL("localhost:9998")); |
107 content::WebContents* tab_contents = | 107 content::WebContents* tab_contents = |
108 browser()->tab_strip_model()->GetActiveWebContents(); | 108 browser()->tab_strip_model()->GetActiveWebContents(); |
109 std::string javascript = | 109 std::string javascript = |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 if (!base::PathExists(firefox_launcher)) { | 186 if (!base::PathExists(firefox_launcher)) { |
187 LOG(ERROR) << "Missing firefox launcher at " << | 187 LOG(ERROR) << "Missing firefox launcher at " << |
188 firefox_launcher.value() << ". " << kAdviseOnGclientSolution; | 188 firefox_launcher.value() << ". " << kAdviseOnGclientSolution; |
189 return false; | 189 return false; |
190 } | 190 } |
191 | 191 |
192 CommandLine command_line(firefox_launcher); | 192 CommandLine command_line(firefox_launcher); |
193 command_line.AppendSwitchPath("--binary", firefox_binary); | 193 command_line.AppendSwitchPath("--binary", firefox_binary); |
194 command_line.AppendSwitchASCII("--webpage", url.spec()); | 194 command_line.AppendSwitchASCII("--webpage", url.spec()); |
195 | 195 |
196 VLOG(1) << "Running " << command_line.GetCommandLineString(); | 196 DVLOG(1) << "Running " << command_line.GetCommandLineString(); |
197 return base::LaunchProcess(command_line, base::LaunchOptions(), | 197 return base::LaunchProcess(command_line, base::LaunchOptions(), |
198 &firefox_); | 198 &firefox_); |
199 } | 199 } |
200 | 200 |
201 bool HasWebcamOnSystem() { | 201 bool HasWebcamOnSystem() { |
202 #if defined(OS_LINUX) | 202 #if defined(OS_LINUX) |
203 // Implementation note: normally we would be able to figure this out with | 203 // Implementation note: normally we would be able to figure this out with |
204 // MediaStreamTrack.getSources, but we can't ask Chrome since it runs in | 204 // MediaStreamTrack.getSources, but we can't ask Chrome since it runs in |
205 // fake device mode where it will not enumerate webcams on the system. | 205 // fake device mode where it will not enumerate webcams on the system. |
206 // Therefore, look for /dev/video* entries directly since this test only | 206 // Therefore, look for /dev/video* entries directly since this test only |
(...skipping 13 matching lines...) Expand all Loading... |
220 }; | 220 }; |
221 | 221 |
222 IN_PROC_BROWSER_TEST_F(WebRtcApprtcBrowserTest, MANUAL_WorksOnApprtc) { | 222 IN_PROC_BROWSER_TEST_F(WebRtcApprtcBrowserTest, MANUAL_WorksOnApprtc) { |
223 // Disabled on Win XP: http://code.google.com/p/webrtc/issues/detail?id=2703. | 223 // Disabled on Win XP: http://code.google.com/p/webrtc/issues/detail?id=2703. |
224 if (OnWinXp()) | 224 if (OnWinXp()) |
225 return; | 225 return; |
226 | 226 |
227 DetectErrorsInJavaScript(); | 227 DetectErrorsInJavaScript(); |
228 ASSERT_TRUE(LaunchApprtcInstanceOnLocalhost()); | 228 ASSERT_TRUE(LaunchApprtcInstanceOnLocalhost()); |
229 while (!LocalApprtcInstanceIsUp()) | 229 while (!LocalApprtcInstanceIsUp()) |
230 VLOG(1) << "Waiting for AppRTC to come up..."; | 230 DVLOG(1) << "Waiting for AppRTC to come up..."; |
231 | 231 |
232 GURL room_url = GURL(base::StringPrintf("localhost:9999?r=room_%d", | 232 GURL room_url = GURL(base::StringPrintf("localhost:9999?r=room_%d", |
233 base::RandInt(0, 65536))); | 233 base::RandInt(0, 65536))); |
234 | 234 |
235 chrome::AddTabAt(browser(), GURL(), -1, true); | 235 chrome::AddTabAt(browser(), GURL(), -1, true); |
236 content::WebContents* left_tab = OpenPageAndAcceptUserMedia(room_url); | 236 content::WebContents* left_tab = OpenPageAndAcceptUserMedia(room_url); |
237 | 237 |
238 chrome::AddTabAt(browser(), GURL(), -1, true); | 238 chrome::AddTabAt(browser(), GURL(), -1, true); |
239 content::WebContents* right_tab = OpenPageAndAcceptUserMedia(room_url); | 239 content::WebContents* right_tab = OpenPageAndAcceptUserMedia(room_url); |
240 | 240 |
(...skipping 28 matching lines...) Expand all Loading... |
269 if (!HasWebcamOnSystem()) { | 269 if (!HasWebcamOnSystem()) { |
270 LOG(INFO) | 270 LOG(INFO) |
271 << "Didn't find a webcam on the system; skipping test since Firefox " | 271 << "Didn't find a webcam on the system; skipping test since Firefox " |
272 << "needs to be able to acquire a webcam."; | 272 << "needs to be able to acquire a webcam."; |
273 return; | 273 return; |
274 } | 274 } |
275 | 275 |
276 DetectErrorsInJavaScript(); | 276 DetectErrorsInJavaScript(); |
277 ASSERT_TRUE(LaunchApprtcInstanceOnLocalhost()); | 277 ASSERT_TRUE(LaunchApprtcInstanceOnLocalhost()); |
278 while (!LocalApprtcInstanceIsUp()) | 278 while (!LocalApprtcInstanceIsUp()) |
279 VLOG(1) << "Waiting for AppRTC to come up..."; | 279 DVLOG(1) << "Waiting for AppRTC to come up..."; |
280 | 280 |
281 GURL room_url = GURL(base::StringPrintf("http://localhost:9999?r=room_%d", | 281 GURL room_url = GURL(base::StringPrintf("http://localhost:9999?r=room_%d", |
282 base::RandInt(0, 65536))); | 282 base::RandInt(0, 65536))); |
283 content::WebContents* chrome_tab = OpenPageAndAcceptUserMedia(room_url); | 283 content::WebContents* chrome_tab = OpenPageAndAcceptUserMedia(room_url); |
284 | 284 |
285 ASSERT_TRUE(LaunchFirefoxWithUrl(room_url)); | 285 ASSERT_TRUE(LaunchFirefoxWithUrl(room_url)); |
286 | 286 |
287 ASSERT_TRUE(WaitForCallToComeUp(chrome_tab)); | 287 ASSERT_TRUE(WaitForCallToComeUp(chrome_tab)); |
288 | 288 |
289 // Ensure Firefox manages to send video our way. | 289 // Ensure Firefox manages to send video our way. |
290 ASSERT_TRUE(DetectRemoteVideoPlaying(chrome_tab)); | 290 ASSERT_TRUE(DetectRemoteVideoPlaying(chrome_tab)); |
291 } | 291 } |
OLD | NEW |