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.
6 """Chromoting me2me connect/disconnect related test cases."""
12 class Me2MeConnect(chromoting_base.ChromotingBase):
13 """Drives me2me connect test cases."""
16 """Set up for me2me connect test."""
17 # Disable test on vista and xp until the failure is figured
18 if self.IsWinVista() or self.IsWinXP():
21 pyauto.PyUITest.setUp(self)
23 self.InstallHostDaemon()
24 webapp = self.InstallExtension(self.GetWebappPath())
25 self.host.LaunchApp(webapp)
26 self.host.Authenticate()
27 self.host.StartMe2Me()
28 self.host.CleanupHostList()
29 self.host.EnableConnectionsInstalled()
30 self.client.LaunchApp(webapp)
33 """Mainly uninstalls the host daemon."""
34 # Disable test on vista and xp until the failure is figured
35 if self.IsWinVista() or self.IsWinXP():
38 self.host.DisableConnections()
39 self.UninstallHostDaemon()
41 pyauto.PyUITest.tearDown(self)
44 def testMe2MeConnectDisconnectReconnectDisconnect(self):
45 """Connects, disconnects, reconnects and disconnects"""
46 # Disable test on vista and xp until the failure is figured
47 if self.IsWinVista() or self.IsWinXP():
50 self.client.ConnectMe2Me('111111', 'IN_SESSION',
51 self.client_tab_index)
52 self.client.DisconnectMe2Me(False, self.client_tab_index)
53 self.client.ReconnectMe2Me('111111', self.client_tab_index)
54 self.client.DisconnectMe2Me(True, self.client_tab_index)
56 def testMe2MeConnectWithWrongPin(self):
57 """Connects and disconnects."""
58 # Disable test on vista and xp until the failure is figured
59 if self.IsWinVista() or self.IsWinXP():
62 self.client.ConnectMe2Me('222222', 'CLIENT_CONNECT_FAILED_ME2ME',
63 self.client_tab_index)
64 self.client.ReconnectMe2Me('111111', self.client_tab_index)
65 self.client.DisconnectMe2Me(True, self.client_tab_index)
67 def testMe2MeChangePin(self):
68 """Changes pin, connects with new pin and then disconnects."""
69 # Disable test on vista and xp until the failure is figured
70 if self.IsWinVista() or self.IsWinXP():
73 self.host.ChangePin('222222')
74 self.client.ConnectMe2Me('222222', 'IN_SESSION',
75 self.client_tab_index)
76 self.client.DisconnectMe2Me(True, self.client_tab_index)
78 def testMe2MeChangeName(self):
79 """Changes host name, connects and then disconnects."""
80 # Disable test on vista and xp until the failure is figured
81 if self.IsWinVista() or self.IsWinXP():
84 self.client.ChangeName("Changed")
85 self.client.ConnectMe2Me('111111', 'IN_SESSION',
86 self.client_tab_index)
87 self.client.DisconnectMe2Me(True, self.client_tab_index)
90 if __name__ == '__main__':
91 chromoting_base.Main()