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 ChromotingAuth(chromoting_base.ChromotingBase): |
| 21 """Chromoting authentication related test cases.""" |
| 22 |
| 23 def setUp(self): |
| 24 """Set up for auth test.""" |
| 25 super(ChromotingAuth, self).setUp() |
| 26 |
| 27 self._app = self.InstallExtension(self.GetWebappPath()) |
| 28 self.host.LaunchApp(self._app) |
| 29 self.account = self.GetPrivateInfo()['test_chromoting_account'] |
| 30 |
| 31 def testDenyAllowAccess(self): |
| 32 """Denies access and then allows access.""" |
| 33 self.host.ContinueAuth() |
| 34 self.host.LogIn(self.account['username'], self.account['password']) |
| 35 self.host.DenyAccess() |
| 36 self.host.ContinueAuth() |
| 37 self.host.AllowAccess() |
| 38 |
| 39 def testSignOutAndSignBackIn(self): |
| 40 """Signs out from chromoting and signs back in.""" |
| 41 self.host.ContinueAuth() |
| 42 self.host.LogIn(self.account['username'], self.account['password']) |
| 43 self.host.AllowAccess() |
| 44 self.host.SignOut() |
| 45 self.host.ContinueAuth() |
| 46 self.host.AllowAccess() |
| 47 |
| 48 if __name__ == '__main__': |
| 49 pyauto_functional.Main() |
OLD | NEW |