OLD | NEW |
1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2011 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, shutil, time | 5 import logging, os, shutil, 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 backchannel, cros_ui, cros_ui_test | 8 from autotest_lib.client.cros import backchannel, cros_ui, cros_ui_test |
9 from autotest_lib.client.cros import httpd, login, power_status | 9 from autotest_lib.client.cros import httpd, login, power_status |
10 from autotest_lib.client.cros import flimflam_test_path | 10 from autotest_lib.client.cros import flimflam_test_path |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 self._should_scroll = should_scroll | 71 self._should_scroll = should_scroll |
72 self._should_scroll_up = should_scroll_up | 72 self._should_scroll_up = should_scroll_up |
73 self._scroll_loop = scroll_loop | 73 self._scroll_loop = scroll_loop |
74 self._scroll_interval_ms = scroll_interval_ms | 74 self._scroll_interval_ms = scroll_interval_ms |
75 self._scroll_by_pixels = scroll_by_pixels | 75 self._scroll_by_pixels = scroll_by_pixels |
76 self._tmp_keyvals = {} | 76 self._tmp_keyvals = {} |
77 self._power_status = power_status.get_status() | 77 self._power_status = power_status.get_status() |
78 self._json_path = None | 78 self._json_path = None |
79 self._force_wifi = force_wifi | 79 self._force_wifi = force_wifi |
80 self._testServer = None | 80 self._testServer = None |
81 self._tasks = '\'' + tasks + '\'' | 81 self._tasks = '\'' + tasks.replace(' ','') + '\'' |
82 | 82 |
83 # verify that initial conditions are met: | 83 # verify that initial conditions are met: |
84 if self._power_status.linepower[0].online: | 84 if self._power_status.linepower[0].online: |
85 raise error.TestError( | 85 raise error.TestError( |
86 'Running on AC power. Please remove AC power cable') | 86 'Running on AC power. Please remove AC power cable') |
87 | 87 |
88 percent_initial_charge = self._percent_current_charge() | 88 percent_initial_charge = self._percent_current_charge() |
89 if percent_initial_charge_min and percent_initial_charge < \ | 89 if percent_initial_charge_min and percent_initial_charge < \ |
90 percent_initial_charge_min: | 90 percent_initial_charge_min: |
91 raise error.TestError('Initial charge (%f) less than min (%f)' | 91 raise error.TestError('Initial charge (%f) less than min (%f)' |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 # set backlight level to 40% of max | 330 # set backlight level to 40% of max |
331 cmd = 'backlight-tool --set_brightness %d ' % ( | 331 cmd = 'backlight-tool --set_brightness %d ' % ( |
332 int(self._max_backlight * 0.4)) | 332 int(self._max_backlight * 0.4)) |
333 os.system(cmd) | 333 os.system(cmd) |
334 | 334 |
335 # record brightness level | 335 # record brightness level |
336 cmd = 'backlight-tool --get_brightness' | 336 cmd = 'backlight-tool --get_brightness' |
337 level = int(utils.system_output(cmd).rstrip()) | 337 level = int(utils.system_output(cmd).rstrip()) |
338 logging.info('backlight level is %d' % level) | 338 logging.info('backlight level is %d' % level) |
339 self._tmp_keyvals['level_backlight_current'] = level | 339 self._tmp_keyvals['level_backlight_current'] = level |
OLD | NEW |