Skip to content

Commit

Permalink
fix: Run StartMutedTest in both p2p mode (as intended) and jvb mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrozev committed Jan 29, 2021
1 parent 9b20731 commit f02ae8b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
30 changes: 18 additions & 12 deletions src/test/java/org/jitsi/meet/test/StartMutedTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ public void setupClass()
@Test
public void checkboxesTest()
{
WebDriver driver1 = getParticipant1().getDriver();

WebParticipant participant1 = getParticipant1();

participant1.getToolbar().clickSettingsButton();
Expand Down Expand Up @@ -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();

Expand All @@ -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,
Expand All @@ -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();
Expand All @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/jitsi/meet/test/web/WebParticipant.java
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ public String getProtocol()
* {@inheritDoc}
*/
@Override
protected RtpStatistics getRtpStatistics()
public RtpStatistics getRtpStatistics()
{
return new WebRtpStatistics(this);
}
Expand Down

0 comments on commit f02ae8b

Please sign in to comment.