| 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 "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/infobars/infobar_responder.h" | 13 #include "chrome/browser/infobars/infobar_responder.h" |
| 14 #include "chrome/browser/infobars/infobar_service.h" | 14 #include "chrome/browser/infobars/infobar_service.h" |
| 15 #include "chrome/browser/media/webrtc_browsertest_base.h" | 15 #include "chrome/browser/media/webrtc_browsertest_base.h" |
| 16 #include "chrome/browser/media/webrtc_browsertest_common.h" | 16 #include "chrome/browser/media/webrtc_browsertest_common.h" |
| 17 #include "chrome/browser/permissions/permission_request_manager.h" |
| 17 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
| 18 #include "chrome/browser/ui/browser_tabstrip.h" | 19 #include "chrome/browser/ui/browser_tabstrip.h" |
| 19 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 20 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 20 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" | |
| 21 #include "chrome/common/chrome_switches.h" | 21 #include "chrome/common/chrome_switches.h" |
| 22 #include "chrome/test/base/ui_test_utils.h" | 22 #include "chrome/test/base/ui_test_utils.h" |
| 23 #include "content/public/common/content_switches.h" | 23 #include "content/public/common/content_switches.h" |
| 24 #include "content/public/test/browser_test_utils.h" | 24 #include "content/public/test/browser_test_utils.h" |
| 25 #include "media/base/media_switches.h" | 25 #include "media/base/media_switches.h" |
| 26 #include "net/test/python_utils.h" | 26 #include "net/test/python_utils.h" |
| 27 #include "ui/gl/gl_switches.h" | 27 #include "ui/gl/gl_switches.h" |
| 28 | 28 |
| 29 const char kTitlePageOfAppEngineAdminPage[] = "Instances"; | 29 const char kTitlePageOfAppEngineAdminPage[] = "Instances"; |
| 30 | 30 |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 while (!LocalApprtcInstanceIsUp()) | 236 while (!LocalApprtcInstanceIsUp()) |
| 237 DVLOG(1) << "Waiting for AppRTC to come up..."; | 237 DVLOG(1) << "Waiting for AppRTC to come up..."; |
| 238 | 238 |
| 239 GURL room_url = GURL("http://localhost:9999/r/some_room" | 239 GURL room_url = GURL("http://localhost:9999/r/some_room" |
| 240 "?wshpp=localhost:8089&wstls=false"); | 240 "?wshpp=localhost:8089&wstls=false"); |
| 241 | 241 |
| 242 // Set up the left tab. | 242 // Set up the left tab. |
| 243 chrome::AddTabAt(browser(), GURL(), -1, true); | 243 chrome::AddTabAt(browser(), GURL(), -1, true); |
| 244 content::WebContents* left_tab = | 244 content::WebContents* left_tab = |
| 245 browser()->tab_strip_model()->GetActiveWebContents(); | 245 browser()->tab_strip_model()->GetActiveWebContents(); |
| 246 PermissionBubbleManager::FromWebContents(left_tab) | 246 PermissionRequestManager::FromWebContents(left_tab) |
| 247 ->set_auto_response_for_test(PermissionBubbleManager::ACCEPT_ALL); | 247 ->set_auto_response_for_test(PermissionRequestManager::ACCEPT_ALL); |
| 248 InfoBarResponder left_infobar_responder( | 248 InfoBarResponder left_infobar_responder( |
| 249 InfoBarService::FromWebContents(left_tab), InfoBarResponder::ACCEPT); | 249 InfoBarService::FromWebContents(left_tab), InfoBarResponder::ACCEPT); |
| 250 ui_test_utils::NavigateToURL(browser(), room_url); | 250 ui_test_utils::NavigateToURL(browser(), room_url); |
| 251 | 251 |
| 252 // Set up the right tab. | 252 // Set up the right tab. |
| 253 chrome::AddTabAt(browser(), GURL(), -1, true); | 253 chrome::AddTabAt(browser(), GURL(), -1, true); |
| 254 content::WebContents* right_tab = | 254 content::WebContents* right_tab = |
| 255 browser()->tab_strip_model()->GetActiveWebContents(); | 255 browser()->tab_strip_model()->GetActiveWebContents(); |
| 256 PermissionBubbleManager::FromWebContents(right_tab) | 256 PermissionRequestManager::FromWebContents(right_tab) |
| 257 ->set_auto_response_for_test(PermissionBubbleManager::ACCEPT_ALL); | 257 ->set_auto_response_for_test(PermissionRequestManager::ACCEPT_ALL); |
| 258 InfoBarResponder right_infobar_responder( | 258 InfoBarResponder right_infobar_responder( |
| 259 InfoBarService::FromWebContents(right_tab), InfoBarResponder::ACCEPT); | 259 InfoBarService::FromWebContents(right_tab), InfoBarResponder::ACCEPT); |
| 260 ui_test_utils::NavigateToURL(browser(), room_url); | 260 ui_test_utils::NavigateToURL(browser(), room_url); |
| 261 | 261 |
| 262 ASSERT_TRUE(WaitForCallToComeUp(left_tab)); | 262 ASSERT_TRUE(WaitForCallToComeUp(left_tab)); |
| 263 ASSERT_TRUE(WaitForCallToComeUp(right_tab)); | 263 ASSERT_TRUE(WaitForCallToComeUp(right_tab)); |
| 264 | 264 |
| 265 ASSERT_TRUE(DetectRemoteVideoPlaying(left_tab)); | 265 ASSERT_TRUE(DetectRemoteVideoPlaying(left_tab)); |
| 266 ASSERT_TRUE(DetectRemoteVideoPlaying(right_tab)); | 266 ASSERT_TRUE(DetectRemoteVideoPlaying(right_tab)); |
| 267 | 267 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 284 ASSERT_TRUE(LaunchColliderOnLocalHost("http://localhost:9999", "8089")); | 284 ASSERT_TRUE(LaunchColliderOnLocalHost("http://localhost:9999", "8089")); |
| 285 while (!LocalApprtcInstanceIsUp()) | 285 while (!LocalApprtcInstanceIsUp()) |
| 286 DVLOG(1) << "Waiting for AppRTC to come up..."; | 286 DVLOG(1) << "Waiting for AppRTC to come up..."; |
| 287 | 287 |
| 288 GURL room_url = GURL("http://localhost:9999/r/some_room" | 288 GURL room_url = GURL("http://localhost:9999/r/some_room" |
| 289 "?wshpp=localhost:8089&wstls=false" | 289 "?wshpp=localhost:8089&wstls=false" |
| 290 "&firefox_fake_device=1"); | 290 "&firefox_fake_device=1"); |
| 291 chrome::AddTabAt(browser(), GURL(), -1, true); | 291 chrome::AddTabAt(browser(), GURL(), -1, true); |
| 292 content::WebContents* chrome_tab = | 292 content::WebContents* chrome_tab = |
| 293 browser()->tab_strip_model()->GetActiveWebContents(); | 293 browser()->tab_strip_model()->GetActiveWebContents(); |
| 294 PermissionBubbleManager::FromWebContents(chrome_tab) | 294 PermissionRequestManager::FromWebContents(chrome_tab) |
| 295 ->set_auto_response_for_test(PermissionBubbleManager::ACCEPT_ALL); | 295 ->set_auto_response_for_test(PermissionRequestManager::ACCEPT_ALL); |
| 296 InfoBarResponder infobar_responder( | 296 InfoBarResponder infobar_responder( |
| 297 InfoBarService::FromWebContents(chrome_tab), InfoBarResponder::ACCEPT); | 297 InfoBarService::FromWebContents(chrome_tab), InfoBarResponder::ACCEPT); |
| 298 ui_test_utils::NavigateToURL(browser(), room_url); | 298 ui_test_utils::NavigateToURL(browser(), room_url); |
| 299 | 299 |
| 300 ASSERT_TRUE(LaunchFirefoxWithUrl(room_url)); | 300 ASSERT_TRUE(LaunchFirefoxWithUrl(room_url)); |
| 301 | 301 |
| 302 ASSERT_TRUE(WaitForCallToComeUp(chrome_tab)); | 302 ASSERT_TRUE(WaitForCallToComeUp(chrome_tab)); |
| 303 | 303 |
| 304 // Ensure Firefox manages to send video our way. | 304 // Ensure Firefox manages to send video our way. |
| 305 ASSERT_TRUE(DetectRemoteVideoPlaying(chrome_tab)); | 305 ASSERT_TRUE(DetectRemoteVideoPlaying(chrome_tab)); |
| 306 } | 306 } |
| OLD | NEW |