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

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

Issue 10834229: Fixed race condition in test. Fixed spurious wait requests on shutdown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review updates 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
« no previous file with comments | « chrome/test/data/webrtc/message_handling.js ('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_call.py
diff --git a/chrome/test/functional/webrtc_call.py b/chrome/test/functional/webrtc_call.py
index b3726342a6513fa2ec5c1125c7b2317072e0887a..6af646695c0890205332e601ed484a84dc5966aa 100755
--- a/chrome/test/functional/webrtc_call.py
+++ b/chrome/test/functional/webrtc_call.py
@@ -56,7 +56,7 @@ class WebrtcCallTest(webrtc_test_base.WebrtcTestBase):
pyauto.PyUITest.tearDown(self)
self.assertEquals('', self.CheckErrorsAndCrashes())
- def _SimpleWebRtcCall(self, test_page):
+ def _SimpleWebrtcCall(self, test_page):
"""Tests we can call and hang up with WebRTC.
This test exercises pretty much the whole happy-case for the WebRTC
@@ -95,7 +95,7 @@ class WebrtcCallTest(webrtc_test_base.WebrtcTestBase):
# The hang-up will automatically propagate to the second tab.
self._HangUp(from_tab_with_index=0)
- self._VerifyHungUp(tab_index=1)
+ self._WaitUntilHangUpVerified(tab_index=1)
self._Disconnect(tab_index=0)
self._Disconnect(tab_index=1)
@@ -104,8 +104,8 @@ class WebrtcCallTest(webrtc_test_base.WebrtcTestBase):
self.AssertNoFailures(tab_index=0)
self.AssertNoFailures(tab_index=1)
- def testSimpleWebRtcJsepCall(self):
- self._SimpleWebRtcCall('webrtc_jsep_test.html')
+ def testSimpleWebrtcJsepCall(self):
+ self._SimpleWebrtcCall('webrtc_jsep_test.html')
def testLocalPreview(self):
"""Brings up a local preview and ensures video is playing.
@@ -159,12 +159,16 @@ class WebrtcCallTest(webrtc_test_base.WebrtcTestBase):
def _HangUp(self, from_tab_with_index):
self.assertEquals('ok-call-hung-up', self.ExecuteJavascript(
'hangUp()', tab_index=from_tab_with_index))
- self._VerifyHungUp(from_tab_with_index)
- self.AssertNoFailures(from_tab_with_index)
-
- def _VerifyHungUp(self, tab_index):
- self.assertEquals('no', self.ExecuteJavascript(
- 'is_call_active()', tab_index=tab_index))
+ self._WaitUntilHangUpVerified(tab_index=from_tab_with_index)
+ self.AssertNoFailures(tab_index=from_tab_with_index)
+
+ def _WaitUntilHangUpVerified(self, tab_index):
+ hung_up = self.WaitUntil(
+ function=lambda: self.ExecuteJavascript('is_call_active()',
+ tab_index=tab_index),
+ expect_retval='no')
+ self.assertTrue(hung_up,
+ msg='Timed out while waiting for hang-up to be confirmed.')
def _Disconnect(self, tab_index):
self.assertEquals('ok-disconnected', self.ExecuteJavascript(
« no previous file with comments | « chrome/test/data/webrtc/message_handling.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698