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" |
| 11 #include "base/timer/elapsed_timer.h" |
11 #include "base/win/windows_version.h" | 12 #include "base/win/windows_version.h" |
12 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/media/webrtc_browsertest_base.h" | 14 #include "chrome/browser/media/webrtc_browsertest_base.h" |
14 #include "chrome/browser/media/webrtc_browsertest_common.h" | 15 #include "chrome/browser/media/webrtc_browsertest_common.h" |
15 #include "chrome/browser/ui/browser.h" | 16 #include "chrome/browser/ui/browser.h" |
16 #include "chrome/browser/ui/browser_tabstrip.h" | 17 #include "chrome/browser/ui/browser_tabstrip.h" |
17 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 18 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
18 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
19 #include "chrome/test/base/ui_test_utils.h" | 20 #include "chrome/test/base/ui_test_utils.h" |
20 #include "content/public/test/browser_test_utils.h" | 21 #include "content/public/test/browser_test_utils.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 NOTREACHED(); | 213 NOTREACHED(); |
213 return false; | 214 return false; |
214 } | 215 } |
215 | 216 |
216 private: | 217 private: |
217 base::ProcessHandle dev_appserver_; | 218 base::ProcessHandle dev_appserver_; |
218 base::ProcessHandle firefox_; | 219 base::ProcessHandle firefox_; |
219 }; | 220 }; |
220 | 221 |
221 IN_PROC_BROWSER_TEST_F(WebRtcApprtcBrowserTest, MANUAL_WorksOnApprtc) { | 222 IN_PROC_BROWSER_TEST_F(WebRtcApprtcBrowserTest, MANUAL_WorksOnApprtc) { |
| 223 // TODO(phoglund): temporary diagnostics to debug the crbug.com/377383 |
| 224 // heisenbug. |
| 225 base::ElapsedTimer timer; |
| 226 |
222 // TODO(mcasas): Remove Win version filtering when this bug gets fixed: | 227 // TODO(mcasas): Remove Win version filtering when this bug gets fixed: |
223 // http://code.google.com/p/webrtc/issues/detail?id=2703 | 228 // http://code.google.com/p/webrtc/issues/detail?id=2703 |
224 #if defined(OS_WIN) | 229 #if defined(OS_WIN) |
225 if (base::win::GetVersion() < base::win::VERSION_VISTA) | 230 if (base::win::GetVersion() < base::win::VERSION_VISTA) |
226 return; | 231 return; |
227 #endif | 232 #endif |
228 DetectErrorsInJavaScript(); | 233 DetectErrorsInJavaScript(); |
229 ASSERT_TRUE(LaunchApprtcInstanceOnLocalhost()); | 234 ASSERT_TRUE(LaunchApprtcInstanceOnLocalhost()); |
230 while (!LocalApprtcInstanceIsUp()) | 235 while (!LocalApprtcInstanceIsUp()) |
231 VLOG(1) << "Waiting for AppRTC to come up..."; | 236 VLOG(1) << "Waiting for AppRTC to come up..."; |
232 | 237 |
| 238 LOG(INFO) << "AppRTC server up; " << timer.Elapsed().InSeconds() |
| 239 << " seconds elapsed."; |
| 240 |
233 GURL room_url = GURL(base::StringPrintf("localhost:9999?r=room_%d", | 241 GURL room_url = GURL(base::StringPrintf("localhost:9999?r=room_%d", |
234 base::RandInt(0, 65536))); | 242 base::RandInt(0, 65536))); |
235 | 243 |
236 chrome::AddTabAt(browser(), GURL(), -1, true); | 244 chrome::AddTabAt(browser(), GURL(), -1, true); |
237 content::WebContents* left_tab = OpenPageAndAcceptUserMedia(room_url); | 245 content::WebContents* left_tab = OpenPageAndAcceptUserMedia(room_url); |
| 246 |
| 247 // TODO(phoglund): trying to tease out apprtc races. |
| 248 test::SleepInJavascript(left_tab, 2000); |
| 249 |
238 chrome::AddTabAt(browser(), GURL(), -1, true); | 250 chrome::AddTabAt(browser(), GURL(), -1, true); |
239 content::WebContents* right_tab = OpenPageAndAcceptUserMedia(room_url); | 251 content::WebContents* right_tab = OpenPageAndAcceptUserMedia(room_url); |
240 | 252 |
| 253 LOG(INFO) << "Pages opened; " << timer.Elapsed().InSeconds() |
| 254 << " seconds elapsed."; |
| 255 |
241 ASSERT_TRUE(WaitForCallToComeUp(left_tab)); | 256 ASSERT_TRUE(WaitForCallToComeUp(left_tab)); |
242 ASSERT_TRUE(WaitForCallToComeUp(right_tab)); | 257 ASSERT_TRUE(WaitForCallToComeUp(right_tab)); |
243 | 258 |
| 259 LOG(INFO) << "Call up; " << timer.Elapsed().InSeconds() |
| 260 << " seconds elapsed."; |
| 261 |
244 ASSERT_TRUE(DetectRemoteVideoPlaying(left_tab)); | 262 ASSERT_TRUE(DetectRemoteVideoPlaying(left_tab)); |
245 ASSERT_TRUE(DetectRemoteVideoPlaying(right_tab)); | 263 ASSERT_TRUE(DetectRemoteVideoPlaying(right_tab)); |
246 | 264 |
| 265 LOG(INFO) << "Remote video playing; " << timer.Elapsed().InSeconds() |
| 266 << " seconds elapsed."; |
| 267 |
247 ASSERT_TRUE(HangUpApprtcCall(left_tab)); | 268 ASSERT_TRUE(HangUpApprtcCall(left_tab)); |
248 | 269 |
249 ASSERT_TRUE(WaitForCallToHangUp(left_tab)); | 270 ASSERT_TRUE(WaitForCallToHangUp(left_tab)); |
250 ASSERT_TRUE(WaitForCallToHangUp(right_tab)); | 271 ASSERT_TRUE(WaitForCallToHangUp(right_tab)); |
| 272 |
| 273 LOG(INFO) << "Hung up; " << timer.Elapsed().InSeconds() |
| 274 << " seconds elapsed."; |
| 275 |
| 276 // TODO(phoglund): trying to tease out apprtc races. |
| 277 test::SleepInJavascript(left_tab, 2000); |
| 278 |
| 279 LOG(INFO) << "Slept a bit; " << timer.Elapsed().InSeconds() |
| 280 << " seconds elapsed."; |
251 } | 281 } |
252 | 282 |
253 #if defined(OS_LINUX) | 283 #if defined(OS_LINUX) |
254 #define MAYBE_MANUAL_FirefoxApprtcInteropTest MANUAL_FirefoxApprtcInteropTest | 284 #define MAYBE_MANUAL_FirefoxApprtcInteropTest MANUAL_FirefoxApprtcInteropTest |
255 #else | 285 #else |
256 // Not implemented yet on Windows and Mac. | 286 // Not implemented yet on Windows and Mac. |
257 #define MAYBE_MANUAL_FirefoxApprtcInteropTest DISABLED_MANUAL_FirefoxApprtcInter
opTest | 287 #define MAYBE_MANUAL_FirefoxApprtcInteropTest DISABLED_MANUAL_FirefoxApprtcInter
opTest |
258 #endif | 288 #endif |
259 | 289 |
260 IN_PROC_BROWSER_TEST_F(WebRtcApprtcBrowserTest, | 290 IN_PROC_BROWSER_TEST_F(WebRtcApprtcBrowserTest, |
(...skipping 19 matching lines...) Expand all Loading... |
280 base::RandInt(0, 65536))); | 310 base::RandInt(0, 65536))); |
281 content::WebContents* chrome_tab = OpenPageAndAcceptUserMedia(room_url); | 311 content::WebContents* chrome_tab = OpenPageAndAcceptUserMedia(room_url); |
282 | 312 |
283 ASSERT_TRUE(LaunchFirefoxWithUrl(room_url)); | 313 ASSERT_TRUE(LaunchFirefoxWithUrl(room_url)); |
284 | 314 |
285 ASSERT_TRUE(WaitForCallToComeUp(chrome_tab)); | 315 ASSERT_TRUE(WaitForCallToComeUp(chrome_tab)); |
286 | 316 |
287 // Ensure Firefox manages to send video our way. | 317 // Ensure Firefox manages to send video our way. |
288 ASSERT_TRUE(DetectRemoteVideoPlaying(chrome_tab)); | 318 ASSERT_TRUE(DetectRemoteVideoPlaying(chrome_tab)); |
289 } | 319 } |
OLD | NEW |