Chromium Code Reviews

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

Issue 1754002: Fix Bug 2746: xset is not working in power_LoadTest (Closed)
Patch Set: Simplify change to just fix bug 2746 Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« 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, shutil, time 5 import logging, os, re, shutil, time
6 from autotest_lib.client.bin import test 6 from autotest_lib.client.bin import test
7 from autotest_lib.client.common_lib import error, site_httpd, \ 7 from autotest_lib.client.common_lib import error, site_httpd, \
8 site_power_status, site_ui, utils 8 site_power_status, site_ui, utils
9 9
10 params_dict = { 10 params_dict = {
(...skipping 61 matching lines...)
72 'Ethernet interface is active. Please remove Ethernet cable') 72 'Ethernet interface is active. Please remove Ethernet cable')
73 73
74 # TODO (snanda): 74 # TODO (snanda):
75 # - set brightness level 75 # - set brightness level
76 # - turn off suspend on idle (not implemented yet in Chrome OS) 76 # - turn off suspend on idle (not implemented yet in Chrome OS)
77 77
78 # disable screen locker 78 # disable screen locker
79 os.system('stop screen-locker') 79 os.system('stop screen-locker')
80 80
81 # disable screen blanking 81 # disable screen blanking
82 site_ui.xcommand(os.path.join(self.bindir, 'xset') + ' -dpms') 82 site_ui.xsystem(os.path.join(self.bindir, 'xset') + ' -dpms')
83 83
84 # fix up file perms for the power test extension so that chrome 84 # fix up file perms for the power test extension so that chrome
85 # can access it 85 # can access it
86 os.system('chmod -R 755 %s' % self.bindir) 86 os.system('chmod -R 755 %s' % self.bindir)
87 87
88 # write test parameters to the power extension's params.js file 88 # write test parameters to the power extension's params.js file
89 self._ext_path = os.path.join(self.bindir, 'extension') 89 self._ext_path = os.path.join(self.bindir, 'extension')
90 self._write_ext_params() 90 self._write_ext_params()
91 91
92 # setup a HTTP Server to listen for status updates from the power 92 # setup a HTTP Server to listen for status updates from the power
(...skipping 67 matching lines...)
160 160
161 # record chrome power extension stats 161 # record chrome power extension stats
162 for e in self._form_data: 162 for e in self._form_data:
163 keyvals['ext_' + e] = self._form_data[e] 163 keyvals['ext_' + e] = self._form_data[e]
164 164
165 self.write_perf_keyval(keyvals) 165 self.write_perf_keyval(keyvals)
166 166
167 167
168 def cleanup(self): 168 def cleanup(self):
169 # re-enable screen blanking 169 # re-enable screen blanking
170 site_ui.xcommand(os.path.join(self.bindir, 'xset') + ' +dpms') 170 site_ui.xsystem(os.path.join(self.bindir, 'xset') + ' +dpms')
171 171
172 # re-enable screen locker 172 # re-enable screen locker
173 os.system('start screen-locker') 173 os.system('start screen-locker')
174 174
175 175
176 def _is_network_iface_running(self, name): 176 def _is_network_iface_running(self, name):
177 try: 177 try:
178 out = utils.system_output('ifconfig %s' % name) 178 out = utils.system_output('ifconfig %s' % name)
179 except error.CmdError, e: 179 except error.CmdError, e:
180 logging.info(e) 180 logging.info(e)
(...skipping 47 matching lines...)
228 if latch.is_set(): 228 if latch.is_set():
229 latched = True 229 latched = True
230 self._form_data = self._testServer.get_form_entries() 230 self._form_data = self._testServer.get_form_entries()
231 logging.debug(self._form_data) 231 logging.debug(self._form_data)
232 break 232 break
233 233
234 if not latched: 234 if not latched:
235 logging.debug("Didn't get status back from power extension") 235 logging.debug("Didn't get status back from power extension")
236 236
237 session.close() 237 session.close()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine