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

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

Issue 10832084: Fixed race condition in media_stream_infobar.py. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added docstrings Created 8 years, 5 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 | « chrome/test/functional/webrtc_call.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
new file mode 100644
index 0000000000000000000000000000000000000000..4623aa2308eff3908292d6e18e8d86e7cba56e76
--- /dev/null
+++ b/chrome/test/functional/webrtc_test_base.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import pyauto
+
+
+class WebrtcTestBase(pyauto.PyUITest):
+ """This base class provides helpers for getUserMedia calls."""
+
+ def WaitForGetUserMediaResult(self, tab_index):
+ """Waits until WebRTC has responded to a getUserMedia query.
+
+ Fails an assert if WebRTC doesn't respond within the default timeout.
+
+ Args:
+ tab_index: the tab to query.
+ """
+ def HasResult():
+ return self.GetUserMediaResult(tab_index) != 'not-called-yet'
+ self.assertTrue(self.WaitUntil(HasResult),
+ msg='Timed out while waiting for getUserMedia callback.')
+
+ def GetUserMediaResult(self, tab_index):
+ """Retrieves WebRTC's answer to a user media query.
+
+ Args:
+ tab_index: the tab to query.
+
+ Returns:
+ Specified in obtainGetUserMediaResult() in getusermedia.js.
+ """
+ return self.ExecuteJavascript(
+ 'obtainGetUserMediaResult()', tab_index=tab_index)
« no previous file with comments | « chrome/test/functional/webrtc_call.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698