Index: chrome/browser/media/chrome_webrtc_apprtc_browsertest.cc |
diff --git a/chrome/browser/media/chrome_webrtc_apprtc_browsertest.cc b/chrome/browser/media/chrome_webrtc_apprtc_browsertest.cc |
index 40a8c6f250b32e4277707d2df131cae8738ef689..674e5f0006a24c731cd07654d2abb3e4bc7b5e2a 100644 |
--- a/chrome/browser/media/chrome_webrtc_apprtc_browsertest.cc |
+++ b/chrome/browser/media/chrome_webrtc_apprtc_browsertest.cc |
@@ -122,6 +122,13 @@ class WebRtcApprtcBrowserTest : public WebRtcTestBase { |
return test::PollingWaitUntil(javascript, "1", tab_contents); |
} |
+ bool WaitForCallToHangUp(content::WebContents* tab_contents) { |
+ // Apprtc will set remoteVideo.style.opacity to 1 when the call comes up. |
+ std::string javascript = |
+ "window.domAutomationController.send(remoteVideo.style.opacity)"; |
kjellander_chromium
2014/05/27 09:47:52
We really should have a better way to check this s
|
+ return test::PollingWaitUntil(javascript, "0", tab_contents); |
+ } |
+ |
bool EvalInJavascriptFile(content::WebContents* tab_contents, |
const base::FilePath& path) { |
std::string javascript; |
@@ -152,6 +159,11 @@ class WebRtcApprtcBrowserTest : public WebRtcTestBase { |
return true; |
} |
+ bool HangUpApprtcCall(content::WebContents* tab_contents) { |
+ // This is the same as clicking the Hangup button in the AppRTC call. |
+ return content::ExecuteScript(tab_contents, "onHangup()"); |
+ } |
+ |
base::FilePath GetSourceDir() { |
base::FilePath source_dir; |
PathService::Get(base::DIR_SOURCE_ROOT, &source_dir); |
@@ -231,6 +243,11 @@ IN_PROC_BROWSER_TEST_F(WebRtcApprtcBrowserTest, MANUAL_WorksOnApprtc) { |
ASSERT_TRUE(DetectRemoteVideoPlaying(left_tab)); |
ASSERT_TRUE(DetectRemoteVideoPlaying(right_tab)); |
+ |
+ ASSERT_TRUE(HangUpApprtcCall(left_tab)); |
+ |
+ ASSERT_TRUE(WaitForCallToHangUp(left_tab)); |
+ ASSERT_TRUE(WaitForCallToHangUp(right_tab)); |
} |
#if defined(OS_LINUX) |