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

Side by Side Diff: client/site_tests/desktopui_DoLogin/desktopui_DoLogin.py

Issue 1363002: Add session object so that we have one class that control logged in session (Closed)
Patch Set: Fix comments Created 10 years, 9 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 unified diff | Download patch
OLDNEW
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 os, time 5 import time
6 from autotest_lib.client.bin import site_login, test 6 from autotest_lib.client.bin import site_ui_test
7 from autotest_lib.client.common_lib import error
8 7
9 class desktopui_DoLogin(test.test): 8 class desktopui_DoLogin(site_ui_test.UITest):
10 version = 1 9 version = 1
10
11 11
12 def setup(self): 12 def run_once(self):
13 site_login.setup_autox(self) 13 time.sleep(10) # Local login is so fast, it needs to be slowed down.
kmixter1 2010/03/26 02:38:45 Adding the blocking call to the constructor should
14
15 def run_once(self, script):
16 logged_in = site_login.logged_in()
17
18 # Can't test login while logged in, so logout.
19 if logged_in:
20 if not site_login.attempt_logout():
21 raise error.TestFail('Could not terminate existing session')
22 if not site_login.wait_for_login_manager():
23 raise error.TestFail("Login manager didn't come back")
24
25 # Test account information embedded into json file.
26 if not site_login.attempt_login(self, script):
27 raise error.TestFail('Could not login')
28
29 # If we started logged out, log back out.
30 if not logged_in:
31 site_login.attempt_logout()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698