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

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

Issue 10830159: Added a new test which aims to be really, really mean to WebRTC. Hopefully this will cover some cra… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
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 4623aa2308eff3908292d6e18e8d86e7cba56e76..2c86e931302949b206c0932f618083b3e192330a 100755
--- a/chrome/test/functional/webrtc_test_base.py
+++ b/chrome/test/functional/webrtc_test_base.py
@@ -9,6 +9,19 @@ import pyauto
class WebrtcTestBase(pyauto.PyUITest):
"""This base class provides helpers for getUserMedia calls."""
+ def GetUserMedia(self, tab_index, action='allow'):
+ """Acquires webcam or mic for one tab and returns the result."""
Nirnimesh 2012/08/03 18:32:13 Add Args & Returns: section. Describe what the r
phoglund_chromium 2012/08/06 15:02:18 Done.
+ self.assertEquals('ok-requested', self.ExecuteJavascript(
+ 'getUserMedia(true, true)', tab_index=tab_index))
+
+ self.WaitForInfobarCount(1, tab_index=tab_index)
+ self.PerformActionOnInfobar(action, infobar_index=0, tab_index=tab_index)
+ self.WaitForGetUserMediaResult(tab_index=0)
+
+ result = self.GetUserMediaResult(tab_index=0)
+ self.AssertNoFailures(tab_index)
+ return result
+
def WaitForGetUserMediaResult(self, tab_index):
"""Waits until WebRTC has responded to a getUserMedia query.
@@ -32,4 +45,8 @@ class WebrtcTestBase(pyauto.PyUITest):
Specified in obtainGetUserMediaResult() in getusermedia.js.
"""
return self.ExecuteJavascript(
- 'obtainGetUserMediaResult()', tab_index=tab_index)
+ 'obtainGetUserMediaResult()', tab_index=tab_index)
+
+ def AssertNoFailures(self, tab_index):
+ self.assertEquals('ok-no-errors', self.ExecuteJavascript(
+ 'getAnyTestFailures()', tab_index=tab_index))
« chrome/test/functional/webrtc_call.py ('K') | « chrome/test/functional/webrtc_call.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698