OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import logging | 6 import logging |
7 import os | 7 import os |
8 import sys | 8 import sys |
9 | 9 |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... | |
21 class ChromeosUtils(pyauto.PyUITest): | 21 class ChromeosUtils(pyauto.PyUITest): |
22 """Utils for ChromeOS.""" | 22 """Utils for ChromeOS.""" |
23 | 23 |
24 def LoginToDefaultAccount(self): | 24 def LoginToDefaultAccount(self): |
25 """Login to ChromeOS using default testing account. | 25 """Login to ChromeOS using default testing account. |
26 | 26 |
27 Usage: | 27 Usage: |
28 python chromeos_utils.py \ | 28 python chromeos_utils.py \ |
29 chromeos_utils.ChromeosUtils.LoginToDefaultAccount | 29 chromeos_utils.ChromeosUtils.LoginToDefaultAccount |
30 """ | 30 """ |
31 if self.GetLoginInfo()['is_logged_in']: | 31 # Should auto-login. Nothing to do here. |
dennis_jeffrey
2012/08/13 16:37:35
should we add a TODO to remove this function (and
| |
32 logging.info('Already logged in as %s.' % self.GetLoginInfo()['email']) | 32 pass |
33 return | |
34 creds = constants.CREDENTIALS['$default'] | |
35 username = creds[0] | |
36 passwd = creds[1] | |
37 self.Login(username, passwd) | |
38 assert self.GetLoginInfo()['is_logged_in'] | |
39 logging.info('Logged in as %s.' % username) | |
40 | 33 |
41 | 34 |
42 if __name__ == '__main__': | 35 if __name__ == '__main__': |
43 pyauto.Main() | 36 pyauto.Main() |
OLD | NEW |