blob: 9e175a385aeb2f6eb93aed0ff95e82bc94ad97d3 [file] [log] [blame]
Ruben Brunk370e2432014-10-14 18:33:23 -07001# 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 Portmannb9fea5c2021-03-19 14:14:58 -070014"""CameraITS test that a capture result is returned from a manual capture.
15"""
Ruben Brunk370e2432014-10-14 18:33:23 -070016
Ruben Brunk370e2432014-10-14 18:33:23 -070017import pprint
Clemenz Portmann6816c022021-03-01 13:00:12 -080018from mobly import test_runner
Ruben Brunk370e2432014-10-14 18:33:23 -070019
Clemenz Portmann6816c022021-03-01 13:00:12 -080020import its_base_test
21import camera_properties_utils
22import capture_request_utils
23import its_session_utils
Ruben Brunk370e2432014-10-14 18:33:23 -070024
Ruben Brunk370e2432014-10-14 18:33:23 -070025
Clemenz Portmann6816c022021-03-01 13:00:12 -080026class CaptureResultDumpTest(its_base_test.ItsBaseTest):
27 """Test that a capture result is returned from a manual capture and dump it.
28 """
Ruben Brunk370e2432014-10-14 18:33:23 -070029
Clemenz Portmann6816c022021-03-01 13:00:12 -080030 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 Brunk370e2432014-10-14 18:33:23 -070047
48if __name__ == '__main__':
Clemenz Portmann6816c022021-03-01 13:00:12 -080049 test_runner.main()