From f02ae8b69f5ae23691935d8131907ef54d07d338 Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Fri, 15 Jan 2021 09:09:47 -0600 Subject: [PATCH 1/2] fix: Run StartMutedTest in both p2p mode (as intended) and jvb mode. --- .../org/jitsi/meet/test/StartMutedTest.java | 30 +++++++++++-------- .../jitsi/meet/test/web/WebParticipant.java | 2 +- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/test/java/org/jitsi/meet/test/StartMutedTest.java b/src/test/java/org/jitsi/meet/test/StartMutedTest.java index 47bae873e..d47ac46e7 100644 --- a/src/test/java/org/jitsi/meet/test/StartMutedTest.java +++ b/src/test/java/org/jitsi/meet/test/StartMutedTest.java @@ -46,8 +46,6 @@ public void setupClass() @Test public void checkboxesTest() { - WebDriver driver1 = getParticipant1().getDriver(); - WebParticipant participant1 = getParticipant1(); participant1.getToolbar().clickSettingsButton(); @@ -88,8 +86,7 @@ public void configOptionsTest() WebParticipant participant2 = getParticipant2(); final WebDriver driver2 = participant2.getDriver(); - consolePrint(participant1, - "Start configOptionsTest, second participant: " + participant2.getEndpointId()); + consolePrint(participant1, "Start configOptionsTest, second participant: " + participant2.getEndpointId()); participant1.waitForIceConnected(); @@ -103,8 +100,7 @@ public void configOptionsTest() // Unmute and see if the audio works participant2.getToolbar().clickAudioMuteButton(); - consolePrint(participant1, - "configOptionsTest, unmuted second participant"); + consolePrint(participant1, "configOptionsTest, unmuted second participant"); MeetUIUtils.waitForAudioMuted( participant1.getDriver(), driver2, @@ -117,6 +113,12 @@ public void configOptionsTest() */ @Test(dependsOnMethods = { "configOptionsTest" }) public void startWithVideoMutedCanUnmute() + { + startWithVideoMutedCanUnmute(true); + startWithVideoMutedCanUnmute(false); + } + + private void startWithVideoMutedCanUnmute(boolean enableP2p) { WebParticipant participant1 = getParticipant1(); WebParticipant participant2 = getParticipant2(); @@ -138,14 +140,18 @@ public void startWithVideoMutedCanUnmute() hangUpAllParticipants(); - // Explicitly enable P2P due to a regression with unmute not updating - // large video while in P2P. - JitsiMeetUrl url - = getJitsiMeetUrl().appendConfig( - "config.startWithVideoMuted=true&" + - "config.p2p.enabled=true"); + JitsiMeetUrl url = getJitsiMeetUrl() + .appendConfig("config.startWithVideoMuted=true") + .appendConfig("config.p2p.enabled=" + enableP2p); ensureTwoParticipants(url, url); + // Make sure we're using the expected connection (the call starts in jvb and might need some time to switch + // to p2p). + TestUtils.waitForCondition( + participant1.getDriver(), + 5, + d -> participant1.getRtpStatistics().getRtpTransport().isP2P() == enableP2p); + MeetUIUtils.assertMuteIconIsDisplayed( participant1.getDriver(), participant2.getDriver(), diff --git a/src/test/java/org/jitsi/meet/test/web/WebParticipant.java b/src/test/java/org/jitsi/meet/test/web/WebParticipant.java index 75c89ec46..6e61091a2 100644 --- a/src/test/java/org/jitsi/meet/test/web/WebParticipant.java +++ b/src/test/java/org/jitsi/meet/test/web/WebParticipant.java @@ -359,7 +359,7 @@ public String getProtocol() * {@inheritDoc} */ @Override - protected RtpStatistics getRtpStatistics() + public RtpStatistics getRtpStatistics() { return new WebRtpStatistics(this); } From b837eb8ccac550c9cb72021707e53629dd258d7d Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Fri, 29 Jan 2021 10:25:02 -0600 Subject: [PATCH 2/2] squash: Bump timeout. --- src/test/java/org/jitsi/meet/test/StartMutedTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/org/jitsi/meet/test/StartMutedTest.java b/src/test/java/org/jitsi/meet/test/StartMutedTest.java index d47ac46e7..6cf6c0d19 100644 --- a/src/test/java/org/jitsi/meet/test/StartMutedTest.java +++ b/src/test/java/org/jitsi/meet/test/StartMutedTest.java @@ -149,7 +149,7 @@ private void startWithVideoMutedCanUnmute(boolean enableP2p) // to p2p). TestUtils.waitForCondition( participant1.getDriver(), - 5, + 10, d -> participant1.getRtpStatistics().getRtpTransport().isP2P() == enableP2p); MeetUIUtils.assertMuteIconIsDisplayed(