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