Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2656)

Unified Diff: chrome/browser/media/chrome_webrtc_apprtc_browsertest.cc

Issue 301653003: Now explicitly hanging up in AppRTC test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698