OLD | NEW |
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 glob, logging, os, re, stat, time | 5 import glob, logging, os, re, stat, time |
6 | 6 |
7 from autotest_lib.client.bin import test | 7 from autotest_lib.client.bin import test |
8 from autotest_lib.client.common_lib import error, site_ui, utils | 8 from autotest_lib.client.common_lib import error, site_ui, utils |
9 | 9 |
10 class audiovideo_V4L2(test.test): | 10 class audiovideo_V4L2(test.test): |
11 version = 1 | 11 version = 1 |
12 preserve_srcdir = True | 12 preserve_srcdir = True |
13 v4l2_major_dev_num = 81 | 13 v4l2_major_dev_num = 81 |
14 v4l2_minor_dev_num_min = 0 | 14 v4l2_minor_dev_num_min = 0 |
15 v4l2_minor_dev_num_max = 64 | 15 v4l2_minor_dev_num_max = 64 |
16 | 16 |
17 | 17 |
18 def setup(self): | 18 def setup(self): |
19 # TODO(jiesun): make binary here when cross compile issue is resolved. | 19 # TODO(jiesun): make binary here when cross compile issue is resolved. |
20 os.chdir(self.srcdir) | 20 os.chdir(self.srcdir) |
21 utils.system("make clean") | 21 utils.make('clean') |
22 utils.system("make") | 22 utils.make() |
23 | 23 |
24 | 24 |
25 def run_once(self, run_unit_tests=True, run_capture_tests=True, | 25 def run_once(self, run_unit_tests=True, run_capture_tests=True, |
26 run_default_capture_test=False, time=0, | 26 run_default_capture_test=False, time=0, |
27 assert_mandatory_controls=False): | 27 assert_mandatory_controls=False): |
28 | 28 |
29 self.assert_mandatory_controls = assert_mandatory_controls | 29 self.assert_mandatory_controls = assert_mandatory_controls |
30 self.find_video_capture_devices() | 30 self.find_video_capture_devices() |
31 time = time / len(self.v4l2_devices) | 31 time = time / len(self.v4l2_devices) |
32 | 32 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 if (not match or | 203 if (not match or |
204 int(match.group(1)) != width or | 204 int(match.group(1)) != width or |
205 int(match.group(2)) != height or | 205 int(match.group(2)) != height or |
206 match.group(3) != self.supported_formats[0] or | 206 match.group(3) != self.supported_formats[0] or |
207 int(match.group(4)) < minfps): | 207 int(match.group(4)) < minfps): |
208 raise error.TestError("capture test failed") | 208 raise error.TestError("capture test failed") |
209 | 209 |
210 # Run the test again with X display. | 210 # Run the test again with X display. |
211 option.append("--display") | 211 option.append("--display") |
212 okay, stdout = self.run_v4l2_capture_test(False, option) | 212 okay, stdout = self.run_v4l2_capture_test(False, option) |
OLD | NEW |