Ruben Brunk | 370e243 | 2014-10-14 18:33:23 -0700 | [diff] [blame] | 1 | # Copyright 2014 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
Clemenz Portmann | b9fea5c | 2021-03-19 14:14:58 -0700 | [diff] [blame] | 14 | """CameraITS test that a capture result is returned from a manual capture. |
| 15 | """ |
Ruben Brunk | 370e243 | 2014-10-14 18:33:23 -0700 | [diff] [blame] | 16 | |
Ruben Brunk | 370e243 | 2014-10-14 18:33:23 -0700 | [diff] [blame] | 17 | import pprint |
Clemenz Portmann | 6816c02 | 2021-03-01 13:00:12 -0800 | [diff] [blame] | 18 | from mobly import test_runner |
Ruben Brunk | 370e243 | 2014-10-14 18:33:23 -0700 | [diff] [blame] | 19 | |
Clemenz Portmann | 6816c02 | 2021-03-01 13:00:12 -0800 | [diff] [blame] | 20 | import its_base_test |
| 21 | import camera_properties_utils |
| 22 | import capture_request_utils |
| 23 | import its_session_utils |
Ruben Brunk | 370e243 | 2014-10-14 18:33:23 -0700 | [diff] [blame] | 24 | |
Ruben Brunk | 370e243 | 2014-10-14 18:33:23 -0700 | [diff] [blame] | 25 | |
Clemenz Portmann | 6816c02 | 2021-03-01 13:00:12 -0800 | [diff] [blame] | 26 | class CaptureResultDumpTest(its_base_test.ItsBaseTest): |
| 27 | """Test that a capture result is returned from a manual capture and dump it. |
| 28 | """ |
Ruben Brunk | 370e243 | 2014-10-14 18:33:23 -0700 | [diff] [blame] | 29 | |
Clemenz Portmann | 6816c02 | 2021-03-01 13:00:12 -0800 | [diff] [blame] | 30 | def test_capture_result_dump(self): |
| 31 | with its_session_utils.ItsSession( |
| 32 | device_id=self.dut.serial, |
| 33 | camera_id=self.camera_id, |
| 34 | hidden_physical_id=self.hidden_physical_id) as cam: |
| 35 | # Arbitrary capture request exposure values; image content is not |
| 36 | # important for this test, only the metadata. |
| 37 | props = cam.get_camera_properties() |
| 38 | camera_properties_utils.skip_unless( |
| 39 | camera_properties_utils.manual_sensor(props)) |
| 40 | |
| 41 | req, fmt = capture_request_utils.get_fastest_manual_capture_settings( |
| 42 | props) |
| 43 | cap = cam.do_capture(req, fmt) |
| 44 | pprint.pprint(cap['metadata']) |
| 45 | |
| 46 | # No pass/fail check; test passes if it completes. |
Ruben Brunk | 370e243 | 2014-10-14 18:33:23 -0700 | [diff] [blame] | 47 | |
| 48 | if __name__ == '__main__': |
Clemenz Portmann | 6816c02 | 2021-03-01 13:00:12 -0800 | [diff] [blame] | 49 | test_runner.main() |