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. 14"""CameraITS test that a capture result is returned from a manual capture. 15""" 16 17import pprint 18from mobly import test_runner 19 20import its_base_test 21import camera_properties_utils 22import capture_request_utils 23import its_session_utils 24 25 26class CaptureResultDumpTest(its_base_test.ItsBaseTest): 27 """Test that a capture result is returned from a manual capture and dump it. 28 """ 29 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. 47 48if __name__ == '__main__': 49 test_runner.main() 50