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 """Chromoting me2me connect/disconnect related test cases.""" | |
7 | |
8 import chromoting_base | |
9 import pyauto | |
10 | |
11 | |
12 class Me2MeConnect(chromoting_base.ChromotingBase): | |
13 """Drives me2me connect test cases.""" | |
14 | |
15 def setUp(self): | |
16 """Set up for me2me connect test.""" | |
17 pyauto.PyUITest.setUp(self) | |
18 | |
19 self.InstallHostDaemon() | |
20 webapp = self.InstallExtension(self.GetWebappPath()) | |
21 self.host.LaunchApp(webapp) | |
22 self.host.Authenticate() | |
23 self.host.StartMe2Me() | |
24 self.host.EnableConnectionsInstalled() | |
25 self.client.LaunchApp(webapp) | |
26 | |
27 def tearDown(self): | |
28 """Mainly uninstalls the host daemon.""" | |
29 self.host.DisableConnections() | |
30 self.UninstallHostDaemon() | |
31 | |
32 pyauto.PyUITest.tearDown(self) | |
33 | |
34 def testMe2MeConnectDisconnectReconnectDisconnect(self): | |
35 """Connects, disconnects, reconnects and disconnects""" | |
36 self.client.ConnectMe2Me('111111', 'IN_SESSION', | |
37 self.client_tab_index) | |
38 self.client.DisconnectMe2Me(False, self.client_tab_index) | |
39 self.client.ReconnectMe2Me('111111', self.client_tab_index) | |
40 self.client.DisconnectMe2Me(True, self.client_tab_index) | |
41 | |
42 def testMe2MeConnectWithWrongPin(self): | |
43 """Connects and disconnects.""" | |
44 self.client.ConnectMe2Me('222222', 'CLIENT_CONNECT_FAILED_ME2ME', | |
45 self.client_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', | |
53 self.client_tab_index) | |
54 self.client.DisconnectMe2Me(True, self.client_tab_index) | |
55 | |
56 def testMe2MeChangeName(self): | |
57 """Changes host name, connects and then disconnects.""" | |
58 self.client.ChangeName("Changed") | |
59 self.client.ConnectMe2Me('111111', 'IN_SESSION', | |
60 self.client_tab_index) | |
61 self.client.DisconnectMe2Me(True, self.client_tab_index) | |
62 | |
63 | |
64 if __name__ == '__main__': | |
65 chromoting_base.Main() | |
OLD | NEW |