diff options
author | Shuzhen Wang <shuzhenwang@google.com> | 2023-06-28 20:22:55 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-12 01:59:23 +0000 |
commit | 6023e0de7ae46e8e6f19999becc219d0a19597a2 (patch) | |
tree | 7e29034fa8e76dc4a9cda1a7c010880b8a5dee4f | |
parent | a95e1304b8d2987a9db40dcdb43da2842e7b33c2 (diff) | |
download | cts-6023e0de7ae46e8e6f19999becc219d0a19597a2.tar.gz |
Camera: Handle capture error when checking sensor timestamp
When lens switch happens during zoom, there may be capture error.
In that case, the test should handle by not asserting on missing
capture result.
Test: atest CaptureRequestTest#testZoomTimestampIncrease
Bug: 287143649
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:aa716f83dad5f55db676ddd9165d7cce238ece12)
Merged-In: Ie4f4eea0ffec76795fa1c24ed40cbb0a16c16f89
Change-Id: Ie4f4eea0ffec76795fa1c24ed40cbb0a16c16f89
-rw-r--r-- | tests/camera/src/android/hardware/camera2/cts/CaptureRequestTest.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/camera/src/android/hardware/camera2/cts/CaptureRequestTest.java b/tests/camera/src/android/hardware/camera2/cts/CaptureRequestTest.java index f8251283bcc..bb72ac184e7 100644 --- a/tests/camera/src/android/hardware/camera2/cts/CaptureRequestTest.java +++ b/tests/camera/src/android/hardware/camera2/cts/CaptureRequestTest.java @@ -3070,13 +3070,17 @@ public class CaptureRequestTest extends Camera2SurfaceViewTestCase { requests.add(requestBuilder.build()); requests.add(0, requestBuilder.build()); } - mSession.captureBurst(requests, listener, mHandler); + int seqId = mSession.captureBurst(requests, listener, mHandler); - // Check timestamp monotonically increase for thoe whole sequence + // onCaptureSequenceCompleted() trails all capture results. Upon its return, + // we make sure we've received all results/errors. + listener.getCaptureSequenceLastFrameNumber( + seqId, WAIT_FOR_RESULT_TIMEOUT_MS * ZOOM_STEPS); + // Check timestamp monotonically increase for the whole sequence long prevTimestamp = 0; - for (CaptureRequest request : requests) { - TotalCaptureResult result = listener.getTotalCaptureResultForRequest( - request, NUM_RESULTS_WAIT_TIMEOUT); + while (listener.hasMoreResults()) { + TotalCaptureResult result = listener.getTotalCaptureResult( + WAIT_FOR_RESULT_TIMEOUT_MS); long timestamp = getValueNotNull(result, CaptureResult.SENSOR_TIMESTAMP); mCollector.expectGreater("Sensor timestamp must monotonically increase, " + "but changed from " + prevTimestamp + " to " + timestamp, |