summaryrefslogtreecommitdiffstats
path: root/chrome/test/functional/chromoting/it2me_basic.py
blob: 9cdf38f2fe05d47aa30cd239317957ce03c6c79b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/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.

"""Basic tests for Chromoting it2me."""

import chromoting_base
import pyauto


class IT2MeBasic(chromoting_base.ChromotingBase):
  """Drives it2me basic test cases."""

  def setUp(self):
    """Set up for it2me basic test."""
    pyauto.PyUITest.setUp(self)

    webapp = self.InstallExtension(self.GetWebappPath())
    self.LaunchApp(webapp)
    self.Authenticate()

    if self.client_local:
      self.client.LaunchApp(webapp)

  def testIT2MeBasic(self):
    """Verify that we can start and disconnect a Chromoting it2me session."""
    access_code = self.host.Share()
    self.assertTrue(access_code,
                    msg='Host attempted to share, but it failed. '
                        'No access code was found.')

    self.client.Connect(access_code, self.client_tab_index)

    self.host.CancelShare()
    self.client.Disconnect(self.client_tab_index)


if __name__ == '__main__':
  chromoting_base.Main()