diff --git a/webrtc-android-framework/src/test/java/io/antmedia/webrtcandroidframework/ScreenCapturerAndroidTest.java b/webrtc-android-framework/src/test/java/io/antmedia/webrtcandroidframework/ScreenCapturerAndroidTest.java index fa8abbbf..936466b6 100644 --- a/webrtc-android-framework/src/test/java/io/antmedia/webrtcandroidframework/ScreenCapturerAndroidTest.java +++ b/webrtc-android-framework/src/test/java/io/antmedia/webrtcandroidframework/ScreenCapturerAndroidTest.java @@ -13,13 +13,17 @@ import android.hardware.display.VirtualDisplay; import android.media.projection.MediaProjection; import android.media.projection.MediaProjectionManager; +import android.util.Log; import android.view.Display; import android.view.Surface; import android.view.WindowManager; import androidx.annotation.Nullable; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.TestWatcher; +import org.junit.runner.Description; import org.mockito.Mockito; import org.webrtc.CapturerObserver; import org.webrtc.ScreenCapturerAndroid; @@ -28,6 +32,27 @@ public class ScreenCapturerAndroidTest { + @Rule + public TestWatcher watchman= new TestWatcher() { + + @Override + protected void failed(Throwable e, Description description) { + Log.i("TestWatcher", "*** "+description + " failed!\n"); + } + + @Override + protected void succeeded(Description description) { + Log.i("TestWatcher", "*** "+description + " succeeded!\n"); + } + + protected void starting(Description description) { + Log.i("TestWatcher", "******\n*** "+description + " starting!\n"); + } + + protected void finished(Description description) { + Log.i("TestWatcher", "*** "+description + " finished!\n******\n"); + } + }; @Test public void testRotateScreen() { diff --git a/webrtc-android-framework/src/test/java/io/antmedia/webrtcandroidframework/WebRTCClientTest.java b/webrtc-android-framework/src/test/java/io/antmedia/webrtcandroidframework/WebRTCClientTest.java index 341705d8..d5faa8fc 100644 --- a/webrtc-android-framework/src/test/java/io/antmedia/webrtcandroidframework/WebRTCClientTest.java +++ b/webrtc-android-framework/src/test/java/io/antmedia/webrtcandroidframework/WebRTCClientTest.java @@ -907,6 +907,11 @@ public void testCreatePeerConnection() { verify(webRTCClient, never()).reportError(eq(streamId), anyString()); + try { + Thread.sleep(2000); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } doThrow(new NullPointerException()).when(webRTCClient).createMediaConstraintsInternal(); webRTCClient.createPeerConnection(streamId); verify(webRTCClient, timeout(10000)).reportError(eq(streamId), anyString());