diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2013-08-13 12:09:44 -0700 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2013-08-23 14:20:35 -0700 |
commit | 8ebd52bf4166a5ef8b7e91c9e3ecce2ce27cff12 (patch) | |
tree | b78e0dedc23a07066a8d3e492ff2bc229dbfe7bb /media/tests/MediaFrameworkTest/src | |
parent | b8d3a3de675a42b0eed6117eca509c42903d7ee3 (diff) | |
download | frameworks_base-8ebd52bf4166a5ef8b7e91c9e3ecce2ce27cff12.zip frameworks_base-8ebd52bf4166a5ef8b7e91c9e3ecce2ce27cff12.tar.gz frameworks_base-8ebd52bf4166a5ef8b7e91c9e3ecce2ce27cff12.tar.bz2 |
Camera2: Add CameraDevice#flush()
- For quickly clearing out all pending and in-progress captures
Bug: 9758581
Change-Id: Ie4123fcc4d4b648a11d4a6257c531f07182bab39
Diffstat (limited to 'media/tests/MediaFrameworkTest/src')
-rw-r--r-- | media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraDeviceBinderTest.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraDeviceBinderTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraDeviceBinderTest.java index 722087c..2f271bb 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraDeviceBinderTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraDeviceBinderTest.java @@ -309,4 +309,34 @@ public class CameraDeviceBinderTest extends AndroidTestCase { argThat(matcher)); request.close(); } + + @SmallTest + public void testFlush() throws Exception { + int status; + + // Initial flush should work + status = mCameraUser.flush(); + assertEquals(CameraBinderTestUtils.NO_ERROR, status); + + // Then set up a stream + CaptureRequest request = createDefaultRequest(/* needStream */true); + + // Flush should still be a no-op, really + status = mCameraUser.flush(); + assertEquals(CameraBinderTestUtils.NO_ERROR, status); + + // Submit a few capture requests + int requestId1 = submitCameraRequest(request, /* streaming */false); + int requestId2 = submitCameraRequest(request, /* streaming */false); + int requestId3 = submitCameraRequest(request, /* streaming */false); + int requestId4 = submitCameraRequest(request, /* streaming */false); + int requestId5 = submitCameraRequest(request, /* streaming */false); + + // Then flush + status = mCameraUser.flush(); + assertEquals(CameraBinderTestUtils.NO_ERROR, status); + + // TODO: When errors are hooked up, count that errors + successful + // requests equal to 5. + } } |