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

Unified Diff: chrome/test/functional/webrtc_test_base.py

Issue 11428073: Wrote audio- and video-only WebRTC call tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
Index: chrome/test/functional/webrtc_test_base.py
diff --git a/chrome/test/functional/webrtc_test_base.py b/chrome/test/functional/webrtc_test_base.py
index aab75b9472f8256c9bc448e76498d7d3b98a0053..5b4b1630c5494354129951a850d782e5df58b6ff 100755
--- a/chrome/test/functional/webrtc_test_base.py
+++ b/chrome/test/functional/webrtc_test_base.py
@@ -21,19 +21,24 @@ class WebrtcTestBase(pyauto.PyUITest):
extra_flags = ['--enable-media-stream', '--enable-peer-connection']
return pyauto.PyUITest.ExtraChromeFlags(self) + extra_flags
- def GetUserMedia(self, tab_index, action='allow'):
+ def GetUserMedia(self, tab_index, action='allow',
+ request_video=True, request_audio=True):
"""Acquires webcam or mic for one tab and returns the result.
Args:
tab_index: The tab to request user media on.
action: The action to take on the info bar. Can be 'allow', 'deny' or
'dismiss'.
+ request_video: Whether to request video.
+ request_audio: Whether to request audio.
Returns:
A string as specified by the getUserMedia javascript function.
"""
+ constraints = '{ video: %s, audio: %s }' % (str(request_video).lower(),
+ str(request_audio).lower())
self.assertEquals('ok-requested', self.ExecuteJavascript(
- 'getUserMedia("{ audio: true, video: true, }")', tab_index=tab_index))
+ 'getUserMedia("%s")' % constraints, tab_index=tab_index))
self.WaitForInfobarCount(1, tab_index=tab_index)
self.PerformActionOnInfobar(action, infobar_index=0, tab_index=tab_index)

Powered by Google App Engine
This is Rietveld 408576698