| OLD | NEW |
| (Empty) | |
| 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 import os |
| 7 |
| 8 os.sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))
)) |
| 9 |
| 10 import pyauto_functional # Must come before chromoting and pyauto. |
| 11 import chromoting |
| 12 import pyauto |
| 13 |
| 14 import chromoting_base |
| 15 |
| 16 class Me2MeConnect(chromoting_base.ChromotingBase): |
| 17 """Chromoting me2me connect/disconnect related test cases.""" |
| 18 |
| 19 def setUp(self): |
| 20 """Set up for me2me connect test.""" |
| 21 super(Me2MeConnect, self).setUp() |
| 22 |
| 23 self.InstallHostDaemon() |
| 24 self._app = self.InstallExtension(self.GetWebappPath()) |
| 25 self.host.LaunchApp(self._app) |
| 26 self.host.Authenticate() |
| 27 self.host.GetMe2MeStarted() |
| 28 self.host.EnableConnectionsInstalled() |
| 29 self.client.LaunchApp(self._app) |
| 30 |
| 31 def tearDown(self): |
| 32 """Mainly uninstalls the host daemon.""" |
| 33 self.host.DisableConnections() |
| 34 self.UninstallHostDaemon() |
| 35 |
| 36 def testMe2MeConnectDisconnectReconnectDisconnect(self): |
| 37 """Connects, disconnects, reconnects and disconnects""" |
| 38 self.client.ConnectMe2Me("111111", "IN_SESSION", self.client_tab_index) |
| 39 self.client.DisconnectMe2Me(False, self.client_tab_index) |
| 40 self.client.ReconnectMe2Me("111111", self.client_tab_index) |
| 41 self.client.DisconnectMe2Me(True, self.client_tab_index) |
| 42 |
| 43 def testMe2MeConnectWithWrongPin(self): |
| 44 """Connects and disconnects.""" |
| 45 self.client.ConnectMe2Me("222222", "CLIENT_CONNECT_FAILED_ME2ME", self.clien
t_tab_index) |
| 46 self.client.ReconnectMe2Me("111111", self.client_tab_index) |
| 47 self.client.DisconnectMe2Me(True, self.client_tab_index) |
| 48 |
| 49 def testMe2MeChangePin(self): |
| 50 """Changes pin, connects with new pin and then disconnects.""" |
| 51 self.host.ChangePin("222222") |
| 52 self.client.ConnectMe2Me("222222", "IN_SESSION", self.client_tab_index) |
| 53 self.client.DisconnectMe2Me(True, self.client_tab_index) |
| 54 |
| 55 def testMe2MeChangeName(self): |
| 56 """Changes host name, connects and then disconnects.""" |
| 57 self.client.ChangeName("Changed") |
| 58 self.client.ConnectMe2Me("111111", "IN_SESSION", self.client_tab_index) |
| 59 self.client.DisconnectMe2Me(True, self.client_tab_index) |
| 60 |
| 61 if __name__ == '__main__': |
| 62 pyauto_functional.Main() |
| OLD | NEW |