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 "build/build_config.h" | 10 #include "build/build_config.h" |
11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
12 #include "chrome/browser/infobars/infobar_responder.h" | 12 #include "chrome/browser/infobars/infobar_responder.h" |
13 #include "chrome/browser/infobars/infobar_service.h" | 13 #include "chrome/browser/infobars/infobar_service.h" |
14 #include "chrome/browser/media/webrtc/webrtc_browsertest_base.h" | 14 #include "chrome/browser/media/webrtc/webrtc_browsertest_base.h" |
15 #include "chrome/browser/media/webrtc/webrtc_browsertest_common.h" | 15 #include "chrome/browser/media/webrtc/webrtc_browsertest_common.h" |
16 #include "chrome/browser/permissions/permission_request_manager.h" | 16 #include "chrome/browser/permissions/permission_request_manager.h" |
17 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
18 #include "chrome/browser/ui/browser_tabstrip.h" | 18 #include "chrome/browser/ui/browser_tabstrip.h" |
19 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 19 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
20 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
21 #include "chrome/test/base/ui_test_utils.h" | 21 #include "chrome/test/base/ui_test_utils.h" |
22 #include "content/public/common/content_switches.h" | 22 #include "content/public/common/content_switches.h" |
23 #include "content/public/test/browser_test_utils.h" | 23 #include "content/public/test/browser_test_utils.h" |
24 #include "media/base/media_switches.h" | 24 #include "media/base/media_switches.h" |
25 #include "net/test/python_utils.h" | 25 #include "net/test/python_utils.h" |
26 #include "ui/gl/gl_switches.h" | 26 #include "ui/gl/gl_switches.h" |
27 | 27 |
28 #if defined(OS_MACOSX) | |
jam
2017/04/27 01:06:41
nit: no need to ifdef this
emircan
2017/04/27 01:26:47
Done.
| |
29 #include "base/threading/thread_restrictions.h" | |
30 #endif // defined(OS_MACOSX) | |
31 | |
28 const char kTitlePageOfAppEngineAdminPage[] = "Instances"; | 32 const char kTitlePageOfAppEngineAdminPage[] = "Instances"; |
29 | 33 |
30 const char kIsApprtcCallUpJavascript[] = | 34 const char kIsApprtcCallUpJavascript[] = |
31 "var remoteVideo = document.querySelector('#remote-video');" | 35 "var remoteVideo = document.querySelector('#remote-video');" |
32 "var remoteVideoActive =" | 36 "var remoteVideoActive =" |
33 " remoteVideo != null &&" | 37 " remoteVideo != null &&" |
34 " remoteVideo.classList.contains('active');" | 38 " remoteVideo.classList.contains('active');" |
35 "window.domAutomationController.send(remoteVideoActive.toString());"; | 39 "window.domAutomationController.send(remoteVideoActive.toString());"; |
36 | 40 |
37 | 41 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
225 return firefox_.IsValid(); | 229 return firefox_.IsValid(); |
226 } | 230 } |
227 | 231 |
228 private: | 232 private: |
229 base::Process dev_appserver_; | 233 base::Process dev_appserver_; |
230 base::Process firefox_; | 234 base::Process firefox_; |
231 base::Process collider_server_; | 235 base::Process collider_server_; |
232 }; | 236 }; |
233 | 237 |
234 IN_PROC_BROWSER_TEST_F(WebRtcApprtcBrowserTest, MANUAL_WorksOnApprtc) { | 238 IN_PROC_BROWSER_TEST_F(WebRtcApprtcBrowserTest, MANUAL_WorksOnApprtc) { |
239 // crbug.com/684680 | |
240 #if defined(OS_MACOSX) | |
jam
2017/04/27 01:06:41
I'm a bit surprised that this code and other tests
emircan
2017/04/27 01:26:47
Done. It turns out that win is also using this: ht
| |
241 base::ThreadRestrictions::ScopedAllowIO allow_io; | |
242 #endif // defined(OS_MACOSX) | |
235 DetectErrorsInJavaScript(); | 243 DetectErrorsInJavaScript(); |
236 ASSERT_TRUE(LaunchApprtcInstanceOnLocalhost("9999")); | 244 ASSERT_TRUE(LaunchApprtcInstanceOnLocalhost("9999")); |
237 ASSERT_TRUE(LaunchColliderOnLocalHost("http://localhost:9999", "8089")); | 245 ASSERT_TRUE(LaunchColliderOnLocalHost("http://localhost:9999", "8089")); |
238 while (!LocalApprtcInstanceIsUp()) | 246 while (!LocalApprtcInstanceIsUp()) |
239 DVLOG(1) << "Waiting for AppRTC to come up..."; | 247 DVLOG(1) << "Waiting for AppRTC to come up..."; |
240 | 248 |
241 GURL room_url = GURL("http://localhost:9999/r/some_room" | 249 GURL room_url = GURL("http://localhost:9999/r/some_room" |
242 "?wshpp=localhost:8089&wstls=false"); | 250 "?wshpp=localhost:8089&wstls=false"); |
243 | 251 |
244 // Set up the left tab. | 252 // Set up the left tab. |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
298 InfoBarService::FromWebContents(chrome_tab), InfoBarResponder::ACCEPT); | 306 InfoBarService::FromWebContents(chrome_tab), InfoBarResponder::ACCEPT); |
299 ui_test_utils::NavigateToURL(browser(), room_url); | 307 ui_test_utils::NavigateToURL(browser(), room_url); |
300 | 308 |
301 ASSERT_TRUE(LaunchFirefoxWithUrl(room_url)); | 309 ASSERT_TRUE(LaunchFirefoxWithUrl(room_url)); |
302 | 310 |
303 ASSERT_TRUE(WaitForCallToComeUp(chrome_tab)); | 311 ASSERT_TRUE(WaitForCallToComeUp(chrome_tab)); |
304 | 312 |
305 // Ensure Firefox manages to send video our way. | 313 // Ensure Firefox manages to send video our way. |
306 ASSERT_TRUE(DetectRemoteVideoPlaying(chrome_tab)); | 314 ASSERT_TRUE(DetectRemoteVideoPlaying(chrome_tab)); |
307 } | 315 } |
OLD | NEW |