diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2013-08-27 16:49:04 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-08-27 16:49:04 +0000 |
commit | fb3d78118b59cf7e44d780c6a0a050f3b3a7076e (patch) | |
tree | be4847dba3053cdc101377f54749e6300b9be9de /media/tests | |
parent | 4a9c7fec662315d9da48f0f5f99313f270424b48 (diff) | |
parent | 8ebd52bf4166a5ef8b7e91c9e3ecce2ce27cff12 (diff) | |
download | frameworks_base-fb3d78118b59cf7e44d780c6a0a050f3b3a7076e.zip frameworks_base-fb3d78118b59cf7e44d780c6a0a050f3b3a7076e.tar.gz frameworks_base-fb3d78118b59cf7e44d780c6a0a050f3b3a7076e.tar.bz2 |
Merge "Camera2: Add CameraDevice#flush()" into klp-dev
Diffstat (limited to 'media/tests')
-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. + } } |