Updated liblinphone to reduce the list of android supported video resolutions + call transfer test added
This commit is contained in:
parent
f16f5597c7
commit
ebaeaa47cd
2 changed files with 59 additions and 1 deletions
|
@ -1 +1 @@
|
||||||
Subproject commit 809123e9500c15663d51b32c7129ae150f00a6da
|
Subproject commit d8fcf36e4b7dadaf11073e20cbb9429edd583d7c
|
58
tests/src/org/linphone/test/Transfer.java
Normal file
58
tests/src/org/linphone/test/Transfer.java
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
package org.linphone.test;
|
||||||
|
|
||||||
|
import junit.framework.Assert;
|
||||||
|
|
||||||
|
import org.linphone.InCallActivity;
|
||||||
|
import org.linphone.LinphoneActivity;
|
||||||
|
import org.linphone.LinphoneManager;
|
||||||
|
import org.linphone.core.LinphoneCall;
|
||||||
|
import org.linphone.mediastream.Log;
|
||||||
|
|
||||||
|
import android.test.suitebuilder.annotation.LargeTest;
|
||||||
|
import android.test.suitebuilder.annotation.MediumTest;
|
||||||
|
import android.test.suitebuilder.annotation.SmallTest;
|
||||||
|
|
||||||
|
public class Transfer extends SampleTest {
|
||||||
|
@SmallTest
|
||||||
|
@MediumTest
|
||||||
|
@LargeTest
|
||||||
|
public void testACallTransfer() {
|
||||||
|
solo.enterText(0, iContext.getString(org.linphone.test.R.string.account_test_calls_login) + "@" + iContext.getString(org.linphone.test.R.string.account_test_calls_domain));
|
||||||
|
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||||
|
|
||||||
|
assertCallIsCorrectlyRunning();
|
||||||
|
|
||||||
|
solo.clickOnView(solo.getView(org.linphone.R.id.options));
|
||||||
|
solo.clickOnView(solo.getView(org.linphone.R.id.transfer));
|
||||||
|
solo.waitForActivity("LinphoneActivity", 5000);
|
||||||
|
solo.assertCurrentActivity("Expected Linphone Activity", LinphoneActivity.class);
|
||||||
|
|
||||||
|
solo.enterText(0, iContext.getString(org.linphone.test.R.string.conference_account_login) + "@" + iContext.getString(org.linphone.test.R.string.conference_account_domain));
|
||||||
|
solo.clickOnView(solo.getView(org.linphone.R.id.Call)); // Transfer button as the same id, only the image changes
|
||||||
|
|
||||||
|
solo.sleep(2000);
|
||||||
|
Assert.assertTrue(LinphoneTestManager.getLc(1).getCallsNb() > 0);
|
||||||
|
Assert.assertTrue(LinphoneTestManager.getLc(2).getCallsNb() > 0);
|
||||||
|
LinphoneTestManager.getLc(1).terminateAllCalls();
|
||||||
|
solo.sleep(500);
|
||||||
|
Assert.assertTrue(LinphoneTestManager.getLc(1).getCallsNb() == 0);
|
||||||
|
Assert.assertTrue(LinphoneTestManager.getLc(2).getCallsNb() == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void assertCallIsCorrectlyRunning() {
|
||||||
|
solo.waitForActivity("InCallActivity", 5000);
|
||||||
|
solo.assertCurrentActivity("Expected InCall Activity", InCallActivity.class);
|
||||||
|
|
||||||
|
solo.sleep(2000);
|
||||||
|
LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
|
||||||
|
|
||||||
|
int retry = 0;
|
||||||
|
while ((call.getState() == LinphoneCall.State.OutgoingProgress || call.getState() == LinphoneCall.State.IncomingReceived) && retry < 5) {
|
||||||
|
solo.sleep(1000);
|
||||||
|
retry++;
|
||||||
|
Log.w("Call in progress but not running, retry = " + retry);
|
||||||
|
}
|
||||||
|
|
||||||
|
Assert.assertEquals(LinphoneCall.State.StreamsRunning, call.getState());
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue