• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python
2# Copyright (c) 2012 The Chromium Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6"""Chromoting me2me enable/disable related test cases."""
7
8import chromoting_base
9import pyauto
10
11
12class Me2MeEnable(chromoting_base.ChromotingBase):
13  """Drives the me2me enable test cases."""
14
15  def setUp(self):
16    """Set up for me2me enable test."""
17    # Disable test on vista and xp until the failure is figured
18    if self.IsWinVista() or self.IsWinXP():
19      return
20
21    pyauto.PyUITest.setUp(self)
22
23    self.InstallHostDaemon()
24    webapp = self.InstallExtension(self.GetWebappPath())
25    self.host.LaunchApp(webapp)
26    self.host.Authenticate()
27    self.host.StartMe2Me()
28
29  def tearDown(self):
30    """Mainly uninstalls the host daemon."""
31    # Disable test on vista and xp until the failure is figured
32    if self.IsWinVista() or self.IsWinXP():
33      return
34
35    self.UninstallHostDaemon()
36
37    pyauto.PyUITest.tearDown(self)
38
39  def testMe2MeEnableDisable(self):
40    """Enables/disables remote connections.
41
42    This test also exercises different pin conditions.
43    """
44    # Disable test on vista and xp until the failure is figured
45    if self.IsWinVista() or self.IsWinXP():
46      return
47
48    self.host.EnableConnectionsInstalled(True)
49    self.host.DisableConnections()
50
51
52if __name__ == '__main__':
53  chromoting_base.Main()
54