Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(607)

Unified Diff: client/cros/cros_ui_test.py

Issue 6825028: [autotest] Ensure that ownership state is properly cleaned during test setup (Closed) Base URL: http://git.chromium.org/git/autotest.git@master
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/cros/cros_ui.py ('k') | client/site_tests/suite_Smoke/control » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/cros/cros_ui_test.py
diff --git a/client/cros/cros_ui_test.py b/client/cros/cros_ui_test.py
index 7659b5527894d15f718edfae24868fef28f4f93b..a1824446b51b2a8022d16604f71e2b6f5d82ace7 100644
--- a/client/cros/cros_ui_test.py
+++ b/client/cros/cros_ui_test.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -168,16 +168,11 @@ class UITest(test.test):
if creds:
self.start_authserver()
- # Fake ownership unless the test is explicitly testing owner creation.
- if not is_creating_owner and not os.access(
- constants.OWNER_KEY_FILE, os.F_OK):
- logging.info('Owner credentials not found. Faking ownership...')
- self.__fake_ownership()
- self.fake_owner = True
-
if login.logged_in():
login.attempt_logout()
+ # The UI must be taken down to ensure that no stale state persists.
+ cros_ui.stop()
(self.username, self.password) = self.__resolve_creds(creds)
# Ensure there's no stale cryptohome from previous tests.
try:
@@ -185,10 +180,16 @@ class UITest(test.test):
except cryptohome.ChromiumOSError as err:
logging.error(err)
- if is_creating_owner:
+ # Fake ownership unless the test is explicitly testing owner creation.
+ if not is_creating_owner:
+ logging.info('Faking ownership...')
+ self.__fake_ownership()
+ self.fake_owner = True
+ else:
logging.info('Erasing stale owner state.')
ownership.clear_ownership()
self.fake_owner = False
+ cros_ui.start()
login.refresh_login_screen()
if self.auto_login:
« no previous file with comments | « client/cros/cros_ui.py ('k') | client/site_tests/suite_Smoke/control » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698