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

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

Issue 3455025: autotest: Increase Chrome first-render timeout (Closed) Base URL: http://git.chromium.org/git/autotest.git
Patch Set: Created 10 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, os, re, time 5 import logging, os, re, time
6 from autotest_lib.client.bin import site_login, site_ui_test, site_utils 6 from autotest_lib.client.bin import site_login, site_ui_test, site_utils
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 _LOGIN_SUCCESS_FILE = '/tmp/uptime-login-success' 13 _LOGIN_SUCCESS_FILE = '/tmp/uptime-login-success'
14 _FIRST_RENDER_FILE = '/tmp/uptime-chrome-first-render' 14 _FIRST_RENDER_FILE = '/tmp/uptime-chrome-first-render'
15 15
16 def __parse_uptime(self, target_file): 16 def __parse_uptime(self, target_file):
17 data = file(target_file).read() 17 data = file(target_file).read()
18 time = re.split(r' +', data.strip())[0] 18 time = re.split(r' +', data.strip())[0]
19 return float(time) 19 return float(time)
20 20
21 21
22 def run_once(self): 22 def run_once(self):
23 try: 23 try:
24 site_utils.poll_for_condition( 24 site_utils.poll_for_condition(
25 lambda: os.access(self._LOGIN_SUCCESS_FILE, os.F_OK), 25 lambda: os.access(self._LOGIN_SUCCESS_FILE, os.F_OK),
26 site_login.TimeoutError('Timed out waiting for initial login')) 26 site_login.TimeoutError('Timed out waiting for initial login'))
27 site_utils.poll_for_condition( 27 site_utils.poll_for_condition(
28 lambda: os.access(self._FIRST_RENDER_FILE, os.F_OK), 28 lambda: os.access(self._FIRST_RENDER_FILE, os.F_OK),
29 site_login.TimeoutError('Timed out waiting for initial render')) 29 site_login.TimeoutError('Timed out waiting for initial render'),
30 timeout=60)
30 31
31 start_time = self.__parse_uptime(self._LOGIN_SUCCESS_FILE) 32 start_time = self.__parse_uptime(self._LOGIN_SUCCESS_FILE)
32 end_time = self.__parse_uptime(self._FIRST_RENDER_FILE) 33 end_time = self.__parse_uptime(self._FIRST_RENDER_FILE)
33 self.write_perf_keyval( 34 self.write_perf_keyval(
34 { 'seconds_chrome_first_tab': end_time - start_time }) 35 { 'seconds_chrome_first_tab': end_time - start_time })
35 except IOError, e: 36 except IOError, e:
36 logging.debug(e) 37 logging.debug(e)
37 raise error.TestFail('Login information missing') 38 raise error.TestFail('Login information missing')
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698