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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 base::FilePath appengine_dev_appserver = | 77 base::FilePath appengine_dev_appserver = |
78 GetSourceDir().Append( | 78 GetSourceDir().Append( |
79 FILE_PATH_LITERAL("../google_appengine/dev_appserver.py")); | 79 FILE_PATH_LITERAL("../google_appengine/dev_appserver.py")); |
80 if (!base::PathExists(appengine_dev_appserver)) { | 80 if (!base::PathExists(appengine_dev_appserver)) { |
81 LOG(ERROR) << "Missing appengine sdk at " << | 81 LOG(ERROR) << "Missing appengine sdk at " << |
82 appengine_dev_appserver.value() << ". " << kAdviseOnGclientSolution; | 82 appengine_dev_appserver.value() << ". " << kAdviseOnGclientSolution; |
83 return false; | 83 return false; |
84 } | 84 } |
85 | 85 |
86 base::FilePath apprtc_dir = | 86 base::FilePath apprtc_dir = |
87 GetSourceDir().Append(FILE_PATH_LITERAL("out/apprtc")); | 87 GetSourceDir().Append(FILE_PATH_LITERAL( |
| 88 "out/webrtc-samples/samples/web/content/apprtc")); |
88 if (!base::PathExists(apprtc_dir)) { | 89 if (!base::PathExists(apprtc_dir)) { |
89 LOG(ERROR) << "Missing AppRTC code at " << | 90 LOG(ERROR) << "Missing AppRTC code at " << |
90 apprtc_dir.value() << ". " << kAdviseOnGclientSolution; | 91 apprtc_dir.value() << ". " << kAdviseOnGclientSolution; |
91 return false; | 92 return false; |
92 } | 93 } |
93 | 94 |
94 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); | 95 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); |
95 EXPECT_TRUE(GetPythonCommand(&command_line)); | 96 EXPECT_TRUE(GetPythonCommand(&command_line)); |
96 | 97 |
97 command_line.AppendArgPath(appengine_dev_appserver); | 98 command_line.AppendArgPath(appengine_dev_appserver); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 firefox_ = base::LaunchProcess(command_line, base::LaunchOptions()); | 217 firefox_ = base::LaunchProcess(command_line, base::LaunchOptions()); |
217 return firefox_.IsValid(); | 218 return firefox_.IsValid(); |
218 } | 219 } |
219 | 220 |
220 private: | 221 private: |
221 base::Process dev_appserver_; | 222 base::Process dev_appserver_; |
222 base::Process firefox_; | 223 base::Process firefox_; |
223 base::Process collider_server_; | 224 base::Process collider_server_; |
224 }; | 225 }; |
225 | 226 |
226 IN_PROC_BROWSER_TEST_F(WebRtcApprtcBrowserTest, DISABLED_MANUAL_WorksOnApprtc) { | 227 IN_PROC_BROWSER_TEST_F(WebRtcApprtcBrowserTest, MANUAL_WorksOnApprtc) { |
227 // Disabled on Win XP: http://code.google.com/p/webrtc/issues/detail?id=2703. | 228 // Disabled on Win XP: http://code.google.com/p/webrtc/issues/detail?id=2703. |
228 if (OnWinXp()) | 229 if (OnWinXp()) |
229 return; | 230 return; |
230 | 231 |
231 DetectErrorsInJavaScript(); | 232 DetectErrorsInJavaScript(); |
232 ASSERT_TRUE(LaunchApprtcInstanceOnLocalhost("9999")); | 233 ASSERT_TRUE(LaunchApprtcInstanceOnLocalhost("9999")); |
233 ASSERT_TRUE(LaunchColliderOnLocalHost("http://localhost:9999", "8089")); | 234 ASSERT_TRUE(LaunchColliderOnLocalHost("http://localhost:9999", "8089")); |
234 while (!LocalApprtcInstanceIsUp()) | 235 while (!LocalApprtcInstanceIsUp()) |
235 DVLOG(1) << "Waiting for AppRTC to come up..."; | 236 DVLOG(1) << "Waiting for AppRTC to come up..."; |
236 | 237 |
(...skipping 10 matching lines...) Expand all Loading... |
247 ASSERT_TRUE(WaitForCallToComeUp(right_tab)); | 248 ASSERT_TRUE(WaitForCallToComeUp(right_tab)); |
248 | 249 |
249 ASSERT_TRUE(DetectRemoteVideoPlaying(left_tab)); | 250 ASSERT_TRUE(DetectRemoteVideoPlaying(left_tab)); |
250 ASSERT_TRUE(DetectRemoteVideoPlaying(right_tab)); | 251 ASSERT_TRUE(DetectRemoteVideoPlaying(right_tab)); |
251 | 252 |
252 chrome::CloseWebContents(browser(), left_tab, false); | 253 chrome::CloseWebContents(browser(), left_tab, false); |
253 chrome::CloseWebContents(browser(), right_tab, false); | 254 chrome::CloseWebContents(browser(), right_tab, false); |
254 } | 255 } |
255 | 256 |
256 #if defined(OS_LINUX) | 257 #if defined(OS_LINUX) |
257 #define MAYBE_MANUAL_FirefoxApprtcInteropTest DISABLED_MANUAL_FirefoxApprtcInter
opTest | 258 #define MAYBE_MANUAL_FirefoxApprtcInteropTest MANUAL_FirefoxApprtcInteropTest |
258 #else | 259 #else |
259 // Not implemented yet on Windows and Mac. | 260 // Not implemented yet on Windows and Mac. |
260 #define MAYBE_MANUAL_FirefoxApprtcInteropTest DISABLED_MANUAL_FirefoxApprtcInter
opTest | 261 #define MAYBE_MANUAL_FirefoxApprtcInteropTest DISABLED_MANUAL_FirefoxApprtcInter
opTest |
261 #endif | 262 #endif |
262 | 263 |
263 IN_PROC_BROWSER_TEST_F(WebRtcApprtcBrowserTest, | 264 IN_PROC_BROWSER_TEST_F(WebRtcApprtcBrowserTest, |
264 MAYBE_MANUAL_FirefoxApprtcInteropTest) { | 265 MAYBE_MANUAL_FirefoxApprtcInteropTest) { |
265 // Disabled on Win XP: http://code.google.com/p/webrtc/issues/detail?id=2703. | 266 // Disabled on Win XP: http://code.google.com/p/webrtc/issues/detail?id=2703. |
266 if (OnWinXp()) | 267 if (OnWinXp()) |
267 return; | 268 return; |
268 | 269 |
269 DetectErrorsInJavaScript(); | 270 DetectErrorsInJavaScript(); |
270 ASSERT_TRUE(LaunchApprtcInstanceOnLocalhost("9999")); | 271 ASSERT_TRUE(LaunchApprtcInstanceOnLocalhost("9999")); |
271 ASSERT_TRUE(LaunchColliderOnLocalHost("http://localhost:9999", "8089")); | 272 ASSERT_TRUE(LaunchColliderOnLocalHost("http://localhost:9999", "8089")); |
272 while (!LocalApprtcInstanceIsUp()) | 273 while (!LocalApprtcInstanceIsUp()) |
273 DVLOG(1) << "Waiting for AppRTC to come up..."; | 274 DVLOG(1) << "Waiting for AppRTC to come up..."; |
274 | 275 |
275 GURL room_url = GURL("http://localhost:9999/r/some_room" | 276 GURL room_url = GURL("http://localhost:9999/r/some_room" |
276 "?wshpp=localhost:8089&wstls=false" | 277 "?wshpp=localhost:8089&wstls=false" |
277 "&firefox_fake_device=1"); | 278 "&firefox_fake_device=1"); |
278 content::WebContents* chrome_tab = OpenPageAndAcceptUserMedia(room_url); | 279 content::WebContents* chrome_tab = OpenPageAndAcceptUserMedia(room_url); |
279 | 280 |
280 ASSERT_TRUE(LaunchFirefoxWithUrl(room_url)); | 281 ASSERT_TRUE(LaunchFirefoxWithUrl(room_url)); |
281 | 282 |
282 ASSERT_TRUE(WaitForCallToComeUp(chrome_tab)); | 283 ASSERT_TRUE(WaitForCallToComeUp(chrome_tab)); |
283 | 284 |
284 // Ensure Firefox manages to send video our way. | 285 // Ensure Firefox manages to send video our way. |
285 ASSERT_TRUE(DetectRemoteVideoPlaying(chrome_tab)); | 286 ASSERT_TRUE(DetectRemoteVideoPlaying(chrome_tab)); |
286 } | 287 } |
OLD | NEW |