summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
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.