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

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

Issue 3277004: Move those deps/factory/* to site_tests/suite_Factory/. (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 | client/site_tests/factory_ExtDisplay/factory_ExtDisplay.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # -*- coding: utf-8 -*- 1 # -*- coding: utf-8 -*-
2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 6
7 # DESCRIPTION : 7 # DESCRIPTION :
8 # 8 #
9 # This is a factory test to test the audio. Operator will test both record and 9 # This is a factory test to test the audio. Operator will test both record and
10 # playback for headset and built-in audio. Recordings are played back for 10 # playback for headset and built-in audio. Recordings are played back for
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 def register_callbacks(self, window): 165 def register_callbacks(self, window):
166 window.connect('key-press-event', self.key_press_callback) 166 window.connect('key-press-event', self.key_press_callback)
167 window.add_events(gtk.gdk.KEY_PRESS_MASK) 167 window.add_events(gtk.gdk.KEY_PRESS_MASK)
168 window.connect('key-release-event', self.key_release_callback) 168 window.connect('key-release-event', self.key_release_callback)
169 window.add_events(gtk.gdk.KEY_RELEASE_MASK) 169 window.add_events(gtk.gdk.KEY_RELEASE_MASK)
170 170
171 def locate_audio_sample(self, path): 171 def locate_audio_sample(self, path):
172 if path is None: 172 if path is None:
173 raise error.TestFail('ERROR: Must provide an audio sample') 173 raise error.TestFail('ERROR: Must provide an audio sample')
174 if not os.path.isabs(path): 174 if not os.path.isabs(path):
175 # Assume rel-path samples are in deps/factory. 175 # Assume the relative path is based in autotest directory.
176 path = self.job.autodir + '/deps/factory/' + path 176 path = os.path.join(self.job.autodir, path)
177 if not os.path.exists(path): 177 if not os.path.exists(path):
178 raise error.TestFail('ERROR: Unable to find audio sample %s' % path) 178 raise error.TestFail('ERROR: Unable to find audio sample %s' % path)
179 return path 179 return path
180 180
181 def run_once(self, audio_sample_path=None): 181 def run_once(self, audio_sample_path=None):
182 182
183 factory.log('%s run_once' % self.__class__) 183 factory.log('%s run_once' % self.__class__)
184 184
185 # Write recordings in tmpdir. 185 # Write recordings in tmpdir.
186 os.chdir(self.tmpdir) 186 os.chdir(self.tmpdir)
(...skipping 24 matching lines...) Expand all
211 ful.run_test_widget(self.job, self._test_widget, 211 ful.run_test_widget(self.job, self._test_widget,
212 window_registration_callback=self.register_callbacks) 212 window_registration_callback=self.register_callbacks)
213 213
214 failed_set = set(name for name, status in self._status_map.items() 214 failed_set = set(name for name, status in self._status_map.items()
215 if status is not ful.PASSED) 215 if status is not ful.PASSED)
216 if failed_set: 216 if failed_set:
217 raise error.TestFail('some samples failed (%s)' % 217 raise error.TestFail('some samples failed (%s)' %
218 ', '.join(failed_set)) 218 ', '.join(failed_set))
219 219
220 factory.log('%s run_once finished' % self.__class__) 220 factory.log('%s run_once finished' % self.__class__)
OLDNEW
« no previous file with comments | « no previous file | client/site_tests/factory_ExtDisplay/factory_ExtDisplay.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698