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

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

Issue 1565001: test: Clean up site_login.py a bit. (Closed)
Patch Set: update one more call to attempt_logout() Created 10 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 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 logging, re, time 5 import logging, re, time
6 from autotest_lib.client.bin import site_ui_test 6 from autotest_lib.client.bin import site_ui_test
7 from autotest_lib.client.common_lib import error 7 from autotest_lib.client.common_lib import error
8 8
9 class desktopui_ChromeFirstRender(site_ui_test.UITest): 9 class desktopui_ChromeFirstRender(site_ui_test.UITest):
10 version = 1 10 version = 1
11 11
12 12
13 def __parse_uptime(self, target_file): 13 def __parse_uptime(self, target_file):
14 data = file(target_file).read() 14 data = file(target_file).read()
15 time = re.split(r' +', data.strip())[0] 15 time = re.split(r' +', data.strip())[0]
16 return float(time) 16 return float(time)
17 17
18 18
19 def run_once(self): 19 def run_once(self):
20 try: 20 try:
21 time.sleep(10) # Wait for chrome to render. 21 time.sleep(10) # Wait for chrome to render.
22 start_time = self.__parse_uptime('/tmp/uptime-login-successful') 22 start_time = self.__parse_uptime('/tmp/uptime-login-successful')
23 end_time = self.__parse_uptime('/tmp/uptime-chrome-first-render') 23 end_time = self.__parse_uptime('/tmp/uptime-chrome-first-render')
24 self.write_perf_keyval({'seconds_chrome_first_tab': 24 self.write_perf_keyval(
25 end_time - start_time}) 25 { 'seconds_chrome_first_tab': end_time - start_time })
26 except IOError, e: 26 except IOError, e:
27 logging.debug(e) 27 logging.debug(e)
28 raise error.TestFail('Login information missing') 28 raise error.TestFail('Login information missing')
29
OLDNEW
« no previous file with comments | « client/bin/site_utils.py ('k') | client/site_tests/desktopui_FailedLogin/desktopui_FailedLogin.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698