OLD | NEW |
---|---|
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import logging, os, stat, time, utils | 5 import logging, os, stat, time, utils |
6 from autotest_lib.client.bin import chromeos_constants, site_cryptohome | 6 from autotest_lib.client.bin import chromeos_constants, site_cryptohome |
7 from autotest_lib.client.bin import site_login, test | 7 from autotest_lib.client.bin import site_login, test |
8 from autotest_lib.client.common_lib import error, site_httpd, site_ui | 8 from autotest_lib.client.common_lib import error, site_httpd, site_ui |
9 | 9 |
10 def respond_with_cookies(handler, url_args): | 10 def respond_with_cookies(handler, url_args): |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
49 def cleanup(self): | 49 def cleanup(self): |
50 self._testServer.stop() | 50 self._testServer.stop() |
51 | 51 |
52 | 52 |
53 def run_once(self, script = 'autox_script.json', timeout = 10): | 53 def run_once(self, script = 'autox_script.json', timeout = 10): |
54 logged_in = site_login.logged_in() | 54 logged_in = site_login.logged_in() |
55 | 55 |
56 if not logged_in: | 56 if not logged_in: |
57 # Test account information embedded into json file. | 57 # Test account information embedded into json file. |
58 if not site_login.attempt_login(self, script): | 58 if not site_login.attempt_login(self, script): |
59 raise error.TestERROR('Could not login') | 59 raise error.TestError('Could not login') |
Chris Masone
2010/03/26 07:03:44
Thank you for fixing this
| |
60 | 60 |
61 # Get Default/Cookies mtime. | 61 # Get Default/Cookies mtime. |
62 cookies_info = os.stat(chromeos_constants.LOGIN_PROFILE + '/Cookies') | 62 cookies_info = os.stat(chromeos_constants.LOGIN_PROFILE + '/Cookies') |
63 cookies_mtime = cookies_info[stat.ST_MTIME] | 63 cookies_mtime = cookies_info[stat.ST_MTIME] |
64 | 64 |
65 # "crash" chrome. | 65 # "crash" chrome. |
66 site_login.nuke_process_by_name(chromeos_constants.BROWSER, | 66 site_login.nuke_process_by_name(chromeos_constants.BROWSER, |
67 with_prejudice = True) | 67 with_prejudice = True) |
68 site_login.wait_for_browser() | 68 site_login.wait_for_browser() |
69 | 69 |
(...skipping 18 matching lines...) Expand all Loading... | |
88 | 88 |
89 # Check mtime of Default/Cookies. If changed, KABLOOEY. | 89 # Check mtime of Default/Cookies. If changed, KABLOOEY. |
90 self.__wait_for_login_profile() | 90 self.__wait_for_login_profile() |
91 cookies_info = os.stat(chromeos_constants.LOGIN_PROFILE + '/Cookies') | 91 cookies_info = os.stat(chromeos_constants.LOGIN_PROFILE + '/Cookies') |
92 if cookies_mtime != cookies_info[stat.ST_MTIME]: | 92 if cookies_mtime != cookies_info[stat.ST_MTIME]: |
93 raise error.TestFail('Cookies in Default profile changed!') | 93 raise error.TestFail('Cookies in Default profile changed!') |
94 | 94 |
95 # If we started logged out, log back out. | 95 # If we started logged out, log back out. |
96 if not logged_in: | 96 if not logged_in: |
97 site_login.attempt_logout() | 97 site_login.attempt_logout() |
OLD | NEW |