camera_V4L2: Only test 1600x1200 for internal camera
BUG=chromium:718278
TEST=test_that ${BOARD} camera_V4L2
Change-Id: I08b466b12cd70bda9a1ba9ddde165610973ef209
Reviewed-on: https://chromium-review.googlesource.com/501618
Commit-Ready: Heng-ruey Hsu <henryhsu@google.com>
Tested-by: Heng-ruey Hsu <henryhsu@google.com>
Reviewed-by: Wu-cheng Li <wuchengli@chromium.org>
diff --git a/client/site_tests/camera_V4L2/src/media_v4l2_test.cc b/client/site_tests/camera_V4L2/src/media_v4l2_test.cc
index 8288b01..0b76e84 100644
--- a/client/site_tests/camera_V4L2/src/media_v4l2_test.cc
+++ b/client/site_tests/camera_V4L2/src/media_v4l2_test.cc
@@ -170,7 +170,9 @@
}
// Test all required resolutions with all fps which are larger than 30.
-bool TestResolutions(const std::string& dev_name, bool check_1280x960) {
+bool TestResolutions(const std::string& dev_name,
+ bool check_1280x960,
+ bool check_1600x1200) {
uint32_t buffers = 4;
uint32_t time_to_capture = 3;
V4L2Device::IOMethod io = V4L2Device::IO_METHOD_MMAP;
@@ -192,7 +194,9 @@
required_resolutions.push_back(SupportedFormat(640, 480, 0, 30.0));
required_resolutions.push_back(SupportedFormat(1280, 720, 0, 30.0));
required_resolutions.push_back(SupportedFormat(1920, 1080, 0, 30.0));
- required_resolutions.push_back(SupportedFormat(1600, 1200, 0, 30.0));
+ if (check_1600x1200) {
+ required_resolutions.push_back(SupportedFormat(1600, 1200, 0, 30.0));
+ }
if (check_1280x960) {
required_resolutions.push_back(SupportedFormat(1280, 960, 0, 30.0));
}
@@ -285,19 +289,22 @@
characteristics.GetCharacteristicsFromFile(mapping);
bool check_1280x960 = false;
+ bool check_1600x1200 = false;
if (device_infos.size() > 1) {
printf("[Error] One device should not have multiple configs.\n");
exit(EXIT_FAILURE);
}
if (device_infos.size() == 1) {
check_1280x960 = !device_infos[0].resolution_1280x960_unsupported;
+ check_1600x1200 = !device_infos[0].resolution_1600x1200_unsupported;
}
printf("[Info] check 1280x960: %d\n", check_1280x960);
+ printf("[Info] check 1600x1200: %d\n", check_1600x1200);
if (!TestIO(dev_name))
exit(EXIT_FAILURE);
- if (!TestResolutions(dev_name, check_1280x960))
+ if (!TestResolutions(dev_name, check_1280x960, check_1600x1200))
exit(EXIT_FAILURE);
return EXIT_SUCCESS;