commit cd0bf4ee353629c065a52247deab47391e13624f
parent 1687350ad249afe8fc88f0941736ea2dffa72f27
Author: Pier Angelo Vendrame <pierov@torproject.org>
Date: Tue, 18 Jun 2024 14:02:26 +0200
BB 42616: Remove VideoCaptureTest.kt.
This is a workaround to fix the GeckoView build with WebRTC disabled.
We should replace this workaround with a proper solution, that
excludes this test when MOZ_WEBRTC is undefined/False.
Diffstat:
1 file changed, 0 insertions(+), 58 deletions(-)
diff --git a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/VideoCaptureTest.kt b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/VideoCaptureTest.kt
@@ -1,58 +0,0 @@
-package org.mozilla.geckoview.test
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import androidx.test.platform.app.InstrumentationRegistry
-import org.junit.Assert.assertEquals
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.webrtc.CameraEnumerationAndroid.CaptureFormat
-import org.webrtc.CameraEnumerator
-import org.webrtc.CameraVideoCapturer
-import org.webrtc.CameraVideoCapturer.CameraEventsHandler
-import org.webrtc.videoengine.VideoCaptureAndroid
-
-@RunWith(AndroidJUnit4::class)
-@SmallTest
-class VideoCaptureTest {
- // Always throw exception.
- class BadCameraEnumerator : CameraEnumerator {
- override fun getDeviceNames(): Array<String?>? {
- throw java.lang.RuntimeException("")
- }
-
- override fun isFrontFacing(deviceName: String?): Boolean {
- throw java.lang.RuntimeException("")
- }
-
- override fun isBackFacing(deviceName: String?): Boolean {
- throw java.lang.RuntimeException("")
- }
-
- override fun isInfrared(deviceName: String?): Boolean {
- throw java.lang.RuntimeException("")
- }
-
- override fun getSupportedFormats(deviceName: String?): List<CaptureFormat?>? {
- throw java.lang.RuntimeException("")
- }
-
- override fun createCapturer(
- deviceName: String?,
- eventsHandler: CameraEventsHandler?,
- ): CameraVideoCapturer? {
- throw java.lang.RuntimeException("")
- }
- }
-
- @Test
- fun constructWithBadEnumerator() {
- val ctr = VideoCaptureAndroid::class.java.getDeclaredConstructors()[0].apply { isAccessible = true }
- val capture = ctr.newInstance(
- InstrumentationRegistry.getInstrumentation().targetContext,
- "my camera",
- BadCameraEnumerator(),
- ) as VideoCaptureAndroid
- assertEquals(false, capture.canCapture())
- }
-}