|
|
@ -382,6 +382,7 @@ public class CameraViewTest extends BaseTest { |
|
|
|
|
|
|
|
|
|
|
|
//region testLocation
|
|
|
|
//region testLocation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("ConstantConditions") |
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void testSetLocation() { |
|
|
|
public void testSetLocation() { |
|
|
|
cameraView.setLocation(50d, -50d); |
|
|
|
cameraView.setLocation(50d, -50d); |
|
|
@ -554,6 +555,7 @@ public class CameraViewTest extends BaseTest { |
|
|
|
|
|
|
|
|
|
|
|
//region Lists of listeners and processors
|
|
|
|
//region Lists of listeners and processors
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("UseBulkOperation") |
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void testCameraListenerList() { |
|
|
|
public void testCameraListenerList() { |
|
|
|
assertTrue(cameraView.mListeners.isEmpty()); |
|
|
|
assertTrue(cameraView.mListeners.isEmpty()); |
|
|
@ -571,8 +573,17 @@ public class CameraViewTest extends BaseTest { |
|
|
|
|
|
|
|
|
|
|
|
cameraView.clearCameraListeners(); |
|
|
|
cameraView.clearCameraListeners(); |
|
|
|
assertTrue(cameraView.mListeners.isEmpty()); |
|
|
|
assertTrue(cameraView.mListeners.isEmpty()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Ensure this does not throw a ConcurrentModificationException
|
|
|
|
|
|
|
|
cameraView.addCameraListener(new CameraListener() {}); |
|
|
|
|
|
|
|
cameraView.addCameraListener(new CameraListener() {}); |
|
|
|
|
|
|
|
cameraView.addCameraListener(new CameraListener() {}); |
|
|
|
|
|
|
|
for (CameraListener test : cameraView.mListeners) { |
|
|
|
|
|
|
|
cameraView.mListeners.remove(test); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings({"NullableProblems", "UseBulkOperation"}) |
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void testFrameProcessorsList() { |
|
|
|
public void testFrameProcessorsList() { |
|
|
|
assertTrue(cameraView.mFrameProcessors.isEmpty()); |
|
|
|
assertTrue(cameraView.mFrameProcessors.isEmpty()); |
|
|
@ -592,6 +603,14 @@ public class CameraViewTest extends BaseTest { |
|
|
|
|
|
|
|
|
|
|
|
cameraView.clearFrameProcessors(); |
|
|
|
cameraView.clearFrameProcessors(); |
|
|
|
assertTrue(cameraView.mFrameProcessors.isEmpty()); |
|
|
|
assertTrue(cameraView.mFrameProcessors.isEmpty()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Ensure this does not throw a ConcurrentModificationException
|
|
|
|
|
|
|
|
cameraView.addFrameProcessor(new FrameProcessor() { public void process(Frame f) {} }); |
|
|
|
|
|
|
|
cameraView.addFrameProcessor(new FrameProcessor() { public void process(Frame f) {} }); |
|
|
|
|
|
|
|
cameraView.addFrameProcessor(new FrameProcessor() { public void process(Frame f) {} }); |
|
|
|
|
|
|
|
for (FrameProcessor test : cameraView.mFrameProcessors) { |
|
|
|
|
|
|
|
cameraView.mFrameProcessors.remove(test); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//endregion
|
|
|
|
//endregion
|
|
|
|