Fix video tests

pull/498/head
Mattia Iavarone 6 years ago
parent 87f8f06282
commit 0fcb511224
  1. 2
      cameraview/src/androidTest/java/com/otaliastudios/cameraview/engine/CameraIntegrationTest.java
  2. 3
      cameraview/src/main/java/com/otaliastudios/cameraview/engine/Camera2Engine.java

@ -96,6 +96,8 @@ public abstract class CameraIntegrationTest extends BaseTest {
rule.getActivity().inflate(camera); rule.getActivity().inflate(camera);
// Ensure that controller exceptions are thrown on this thread (not on the UI thread). // Ensure that controller exceptions are thrown on this thread (not on the UI thread).
// TODO this makes debugging for wrong tests very hard, as we don't get the exception
// unless waitForUiException() is called.
uiExceptionOp = new Op<>(true); uiExceptionOp = new Op<>(true);
WorkerHandler crashThread = WorkerHandler.get("CrashThread"); WorkerHandler crashThread = WorkerHandler.get("CrashThread");
crashThread.getThread().setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { crashThread.getThread().setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {

@ -181,6 +181,9 @@ public class Camera2Engine extends CameraEngine implements ImageReader.OnImageAv
mRepeatingRequestBuilder.addTarget(mFrameProcessingSurface); mRepeatingRequestBuilder.addTarget(mFrameProcessingSurface);
} }
for (Surface extraSurface : extraSurfaces) { for (Surface extraSurface : extraSurfaces) {
if (extraSurface == null) {
throw new IllegalArgumentException("Should not add a null surface.");
}
mRepeatingRequestBuilder.addTarget(extraSurface); mRepeatingRequestBuilder.addTarget(extraSurface);
} }
} }

Loading…
Cancel
Save