| OLD | NEW |
| 1 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2009 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 | 5 import logging, os, re |
| 6 | 6 |
| 7 from autotest_lib.client.bin import utils | 7 from autotest_lib.client.bin import utils |
| 8 from autotest_lib.client.common_lib import error | 8 from autotest_lib.client.common_lib import error |
| 9 from autotest_lib.client.cros import ui, ui_test | 9 from autotest_lib.client.cros import cros_ui_test, ui |
| 10 | 10 |
| 11 class graphics_SanAngeles(ui_test.UITest): | 11 class graphics_SanAngeles(cros_ui_test.UITest): |
| 12 version = 1 | 12 version = 1 |
| 13 preserve_srcdir = True | 13 preserve_srcdir = True |
| 14 | 14 |
| 15 | 15 |
| 16 def setup(self): | 16 def setup(self): |
| 17 os.chdir(self.srcdir) | 17 os.chdir(self.srcdir) |
| 18 utils.make('clean') | 18 utils.make('clean') |
| 19 utils.make('all') | 19 utils.make('all') |
| 20 | 20 |
| 21 | 21 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 37 result = utils.run(cmd, ignore_status = True) | 37 result = utils.run(cmd, ignore_status = True) |
| 38 | 38 |
| 39 report = re.findall(r"frame_rate = ([0-9.]+)", result.stdout) | 39 report = re.findall(r"frame_rate = ([0-9.]+)", result.stdout) |
| 40 if len(result.stderr) > 0 or not report: | 40 if len(result.stderr) > 0 or not report: |
| 41 raise error.TestFail('Fail to complete San Angeles Observation' + | 41 raise error.TestFail('Fail to complete San Angeles Observation' + |
| 42 result.stderr) | 42 result.stderr) |
| 43 frame_rate = float(report[0]) | 43 frame_rate = float(report[0]) |
| 44 logging.info('frame_rate = %.1f' % frame_rate) | 44 logging.info('frame_rate = %.1f' % frame_rate) |
| 45 self.write_perf_keyval( | 45 self.write_perf_keyval( |
| 46 {'frames_per_sec_rate_san_angeles': frame_rate}) | 46 {'frames_per_sec_rate_san_angeles': frame_rate}) |
| OLD | NEW |