summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorsimonmorris@chromium.org <simonmorris@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-05 17:06:46 +0000
committersimonmorris@chromium.org <simonmorris@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-05 17:06:46 +0000
commit332318c38f23b2b02b7c886c9c8a5c2a2054d56f (patch)
treef353c61e4415eaf31c97e6073eaafefc4203478d /chrome
parent6502068a36264c55059947a7c1f9f7506be52de8 (diff)
downloadchromium_src-332318c38f23b2b02b7c886c9c8a5c2a2054d56f.zip
chromium_src-332318c38f23b2b02b7c886c9c8a5c2a2054d56f.tar.gz
chromium_src-332318c38f23b2b02b7c886c9c8a5c2a2054d56f.tar.bz2
[Chromoting] Make the PyAuto test wait until the client has received a video frame.
BUG=129791 Review URL: https://chromiumcodereview.appspot.com/10448031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140542 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rwxr-xr-xchrome/test/functional/chromoting_basic.py2
-rw-r--r--chrome/test/pyautolib/chromoting.py13
2 files changed, 11 insertions, 4 deletions
diff --git a/chrome/test/functional/chromoting_basic.py b/chrome/test/functional/chromoting_basic.py
index 7272d1c..e28ab52 100755
--- a/chrome/test/functional/chromoting_basic.py
+++ b/chrome/test/functional/chromoting_basic.py
@@ -52,7 +52,7 @@ class ChromotingBasic(chromoting.ChromotingMixIn, pyauto.PyUITest):
if client_local:
client.LaunchApp(self._app)
- self.assertTrue(client.Connect(access_code, client_tab_index),
+ self.assertTrue(client.Connect(access_code, True, client_tab_index),
msg='The client attempted to connect to the host, '
'but the chromoting session did not start.')
diff --git a/chrome/test/pyautolib/chromoting.py b/chrome/test/pyautolib/chromoting.py
index eb432dd..c608bb7 100644
--- a/chrome/test/pyautolib/chromoting.py
+++ b/chrome/test/pyautolib/chromoting.py
@@ -148,16 +148,23 @@ class ChromotingMixIn(object):
'document.getElementById("access-code-display").innerText',
tab_index, windex)
- def Connect(self, access_code, tab_index=1, windex=0):
+ def Connect(self, access_code, wait_for_frame, tab_index=1, windex=0):
"""Connects to a Chromoting host and starts the session.
Returns:
True on success; False otherwise.
"""
- return self._ExecuteAndWaitForMode(
+ if not self._ExecuteAndWaitForMode(
'document.getElementById("access-code-entry").value = "%s";'
'remoting.connectIt2Me();' % access_code,
- 'IN_SESSION', tab_index, windex)
+ 'IN_SESSION', tab_index, windex):
+ return False
+
+ if wait_for_frame and not self._WaitForJavascriptCondition(
+ 'remoting.clientSession && remoting.clientSession.hasReceivedFrame()',
+ tab_index, windex):
+ return False
+ return True
def CancelShare(self, tab_index=1, windex=0):
"""Stops sharing the desktop on the host side.