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

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

Issue 5740004: Move site_chrome_test, site_logging, site_log_reader, site_crash_test into cros dir. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 11 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
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 utils 6 from autotest_lib.client.bin import utils
7 from autotest_lib.client.common_lib import error 7 from autotest_lib.client.common_lib import error
8 from autotest_lib.client.cros import login, ui_test 8 from autotest_lib.client.cros import cros_ui_test, login
9 9
10 class desktopui_ChromeFirstRender(ui_test.UITest): 10 class desktopui_ChromeFirstRender(cros_ui_test.UITest):
11 version = 1 11 version = 1
12 12
13 13
14 _LOGIN_SUCCESS_FILE = '/tmp/uptime-login-success' 14 _LOGIN_SUCCESS_FILE = '/tmp/uptime-login-success'
15 _FIRST_RENDER_FILE = '/tmp/uptime-chrome-first-render' 15 _FIRST_RENDER_FILE = '/tmp/uptime-chrome-first-render'
16 16
17 def __parse_uptime(self, target_file): 17 def __parse_uptime(self, target_file):
18 data = file(target_file).read() 18 data = file(target_file).read()
19 time = re.split(r' +', data.strip())[0] 19 time = re.split(r' +', data.strip())[0]
20 return float(time) 20 return float(time)
(...skipping 19 matching lines...) Expand all
40 login.TimeoutError('Timeout waiting for initial render'), 40 login.TimeoutError('Timeout waiting for initial render'),
41 timeout=60) 41 timeout=60)
42 42
43 start_time = self.__parse_uptime(self._LOGIN_SUCCESS_FILE) 43 start_time = self.__parse_uptime(self._LOGIN_SUCCESS_FILE)
44 end_time = self.__parse_uptime(self._FIRST_RENDER_FILE) 44 end_time = self.__parse_uptime(self._FIRST_RENDER_FILE)
45 self.write_perf_keyval( 45 self.write_perf_keyval(
46 { 'seconds_chrome_first_tab': end_time - start_time }) 46 { 'seconds_chrome_first_tab': end_time - start_time })
47 except IOError, e: 47 except IOError, e:
48 logging.debug(e) 48 logging.debug(e)
49 raise error.TestFail('Login information missing') 49 raise error.TestFail('Login information missing')
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698