Updated liblinphone for bug fixes + improved tests
This commit is contained in:
parent
e69ff37bce
commit
f68292a759
12 changed files with 135 additions and 84 deletions
|
@ -1 +1 @@
|
||||||
Subproject commit 68a23b44b0ad8d2cf57ff1b93b6abfd510f14779
|
Subproject commit dbba820b5a0b0bf587ed614f6cecd9259f6bae2d
|
|
@ -7,7 +7,7 @@ run-basic-tests:
|
||||||
$(SDK_PATH)/android update test-project --path . -m ../
|
$(SDK_PATH)/android update test-project --path . -m ../
|
||||||
ant debug
|
ant debug
|
||||||
ant installd
|
ant installd
|
||||||
ant test
|
adb shell am instrument -w -e size small org.linphone.test/android.test.InstrumentationTestRunner
|
||||||
|
|
||||||
run-all-tests:
|
run-all-tests:
|
||||||
$(SDK_PLATFORM_TOOLS_PATH)/adb uninstall org.linphone.test
|
$(SDK_PLATFORM_TOOLS_PATH)/adb uninstall org.linphone.test
|
||||||
|
|
|
@ -13,19 +13,19 @@
|
||||||
<string name="account_create_pwd">wizard42</string>
|
<string name="account_create_pwd">wizard42</string>
|
||||||
<string name="account_create_email">wizard42@linphone.org</string>
|
<string name="account_create_email">wizard42@linphone.org</string>
|
||||||
|
|
||||||
<string name="account_test_calls_login">viish</string>
|
<string name="account_test_calls_login">wizard13</string>
|
||||||
<string name="account_test_calls_pwd">lucifer</string>
|
<string name="account_test_calls_pwd">wizard13</string>
|
||||||
<string name="account_test_calls_domain">sip.linphone.org</string>
|
<string name="account_test_calls_domain">sip.linphone.org</string>
|
||||||
|
|
||||||
<string name="contact_name">Cot</string>
|
<string name="contact_name">Wizard</string>
|
||||||
<string name="contact_number">+33952636505</string>
|
<string name="contact_number">+33952636505</string>
|
||||||
<string name="contact_sip">viish@sip.linphone.org</string>
|
<string name="contact_sip">wizard@sip.linphone.org</string>
|
||||||
|
|
||||||
<string name="chat_test_text_sent">Ping!</string>
|
<string name="chat_test_text_sent">Ping!</string>
|
||||||
<string name="chat_test_text_received">Pong!</string>
|
<string name="chat_test_text_received">Pong!</string>
|
||||||
|
|
||||||
<string name="conference_account_login">elviish</string>
|
<string name="conference_account_login">wizard16</string>
|
||||||
<string name="conference_account_password">lucifer</string>
|
<string name="conference_account_password">wizard16</string>
|
||||||
<string name="conference_account_domain">sip.linphone.org</string>
|
<string name="conference_account_domain">sip.linphone.org</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
|
@ -4,13 +4,12 @@ import junit.framework.Assert;
|
||||||
|
|
||||||
import org.linphone.LinphoneActivity;
|
import org.linphone.LinphoneActivity;
|
||||||
import org.linphone.LinphoneManager;
|
import org.linphone.LinphoneManager;
|
||||||
|
import org.linphone.LinphonePreferences;
|
||||||
import org.linphone.core.LinphoneCore.RegistrationState;
|
import org.linphone.core.LinphoneCore.RegistrationState;
|
||||||
import org.linphone.core.LinphoneProxyConfig;
|
import org.linphone.core.LinphoneProxyConfig;
|
||||||
import org.linphone.mediastream.video.capture.hwconf.Hacks;
|
import org.linphone.mediastream.video.capture.hwconf.Hacks;
|
||||||
import org.linphone.setup.SetupActivity;
|
import org.linphone.setup.SetupActivity;
|
||||||
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
import android.test.suitebuilder.annotation.LargeTest;
|
import android.test.suitebuilder.annotation.LargeTest;
|
||||||
import android.test.suitebuilder.annotation.MediumTest;
|
import android.test.suitebuilder.annotation.MediumTest;
|
||||||
import android.test.suitebuilder.annotation.SmallTest;
|
import android.test.suitebuilder.annotation.SmallTest;
|
||||||
|
@ -51,24 +50,23 @@ public class AccountAssistant extends SampleTest {
|
||||||
|
|
||||||
solo.sleep(3000); //Wait for registration to be done
|
solo.sleep(3000); //Wait for registration to be done
|
||||||
LinphoneProxyConfig[] proxyConfigs = LinphoneManager.getLc().getProxyConfigList();
|
LinphoneProxyConfig[] proxyConfigs = LinphoneManager.getLc().getProxyConfigList();
|
||||||
Assert.assertEquals(proxyConfigs.length, 1);
|
Assert.assertEquals(1, proxyConfigs.length);
|
||||||
LinphoneProxyConfig proxyConfig = proxyConfigs[0];
|
LinphoneProxyConfig proxyConfig = proxyConfigs[0];
|
||||||
Assert.assertEquals(RegistrationState.RegistrationOk, proxyConfig.getState());
|
Assert.assertEquals(RegistrationState.RegistrationOk, proxyConfig.getState());
|
||||||
|
|
||||||
//Check the wizard added sip.linphone.org custom settings
|
//Check the wizard added sip.linphone.org custom settings
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
LinphonePreferences prefs = LinphonePreferences.instance();
|
||||||
String stunServer = prefs.getString(aContext.getString(org.linphone.R.string.pref_stun_server_key), "");
|
String stunServer = prefs.getStunServer();
|
||||||
Assert.assertEquals(stunServer, aContext.getString(org.linphone.R.string.default_stun));
|
Assert.assertEquals(aContext.getString(org.linphone.R.string.default_stun), stunServer);
|
||||||
|
|
||||||
String transport = prefs.getString(aContext.getString(org.linphone.R.string.pref_transport_key), aContext.getString(org.linphone.R.string.pref_transport_udp_key));
|
String transport = prefs.getTransportKey();
|
||||||
Assert.assertEquals(transport, aContext.getString(org.linphone.R.string.pref_transport_tls_key));
|
Assert.assertEquals(aContext.getString(org.linphone.R.string.pref_transport_tls_key), transport);
|
||||||
|
|
||||||
String proxy = prefs.getString(aContext.getString(org.linphone.R.string.pref_proxy_key), "");
|
String proxy = prefs.getAccountProxy(0);
|
||||||
Assert.assertEquals(proxy, aContext.getString(org.linphone.R.string.default_domain) + ":5223");
|
Assert.assertEquals(aContext.getString(org.linphone.R.string.default_domain) + ":5223", proxy);
|
||||||
boolean outboundproxy = prefs.getBoolean(aContext.getString(org.linphone.R.string.pref_enable_outbound_proxy_key), false);
|
Assert.assertEquals(true, prefs.isAccountOutboundProxySet(0));
|
||||||
Assert.assertEquals(outboundproxy, true);
|
|
||||||
|
|
||||||
boolean ice = prefs.getBoolean(aContext.getString(org.linphone.R.string.pref_ice_enable_key), false);
|
boolean ice = prefs.isIceEnabled();
|
||||||
Assert.assertEquals(ice, true);
|
Assert.assertEquals(ice, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ import junit.framework.Assert;
|
||||||
import org.linphone.FragmentsAvailable;
|
import org.linphone.FragmentsAvailable;
|
||||||
import org.linphone.LinphoneActivity;
|
import org.linphone.LinphoneActivity;
|
||||||
import org.linphone.LinphoneManager;
|
import org.linphone.LinphoneManager;
|
||||||
|
import org.linphone.LinphonePreferences;
|
||||||
import org.linphone.core.LinphoneCore.RegistrationState;
|
import org.linphone.core.LinphoneCore.RegistrationState;
|
||||||
import org.linphone.core.LinphoneProxyConfig;
|
import org.linphone.core.LinphoneProxyConfig;
|
||||||
|
|
||||||
|
@ -51,7 +52,7 @@ public class AccountManagement extends SampleTest {
|
||||||
solo.goBack();
|
solo.goBack();
|
||||||
|
|
||||||
LinphoneProxyConfig[] proxyConfigs = LinphoneManager.getLc().getProxyConfigList();
|
LinphoneProxyConfig[] proxyConfigs = LinphoneManager.getLc().getProxyConfigList();
|
||||||
Assert.assertEquals(proxyConfigs.length, 1);
|
Assert.assertEquals(1, proxyConfigs.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
@LargeTest
|
@LargeTest
|
||||||
|
@ -64,8 +65,7 @@ public class AccountManagement extends SampleTest {
|
||||||
solo.goBack();
|
solo.goBack();
|
||||||
solo.goBack();
|
solo.goBack();
|
||||||
|
|
||||||
LinphoneProxyConfig[] proxyConfigs = LinphoneManager.getLc().getProxyConfigList();
|
Assert.assertFalse(LinphonePreferences.instance().isAccountEnabled(0));
|
||||||
Assert.assertEquals(proxyConfigs.length, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@LargeTest
|
@LargeTest
|
||||||
|
@ -78,8 +78,7 @@ public class AccountManagement extends SampleTest {
|
||||||
solo.goBack();
|
solo.goBack();
|
||||||
solo.goBack();
|
solo.goBack();
|
||||||
|
|
||||||
LinphoneProxyConfig[] proxyConfigs = LinphoneManager.getLc().getProxyConfigList();
|
Assert.assertTrue(LinphonePreferences.instance().isAccountEnabled(0));
|
||||||
Assert.assertEquals(proxyConfigs.length, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void goToSettings() {
|
private void goToSettings() {
|
||||||
|
|
|
@ -20,7 +20,7 @@ public class AinitTestEnv extends SampleTest {
|
||||||
LinphoneTestManager.createAndStart(aContext, iContext, 1);
|
LinphoneTestManager.createAndStart(aContext, iContext, 1);
|
||||||
|
|
||||||
solo.sleep(2000);
|
solo.sleep(2000);
|
||||||
|
Assert.assertEquals(1, LinphoneTestManager.getLc().getProxyConfigList().length);
|
||||||
Assert.assertEquals(RegistrationState.RegistrationOk, LinphoneTestManager.getLc().getProxyConfigList()[0].getState());
|
Assert.assertEquals(RegistrationState.RegistrationOk, LinphoneTestManager.getLc().getProxyConfigList()[0].getState());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import org.linphone.core.LinphoneCall;
|
||||||
import org.linphone.core.LinphoneCore;
|
import org.linphone.core.LinphoneCore;
|
||||||
import org.linphone.core.LinphoneCoreException;
|
import org.linphone.core.LinphoneCoreException;
|
||||||
import org.linphone.core.PayloadType;
|
import org.linphone.core.PayloadType;
|
||||||
|
import org.linphone.mediastream.Log;
|
||||||
|
|
||||||
import android.test.suitebuilder.annotation.LargeTest;
|
import android.test.suitebuilder.annotation.LargeTest;
|
||||||
import android.test.suitebuilder.annotation.MediumTest;
|
import android.test.suitebuilder.annotation.MediumTest;
|
||||||
|
@ -42,6 +43,8 @@ public class CallsAudio extends SampleTest {
|
||||||
@MediumTest
|
@MediumTest
|
||||||
@LargeTest
|
@LargeTest
|
||||||
public void testBOutgoingCallWithDefaultConfig() {
|
public void testBOutgoingCallWithDefaultConfig() {
|
||||||
|
LinphoneTestManager.getInstance().declineCall = false; // Just in case
|
||||||
|
|
||||||
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.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));
|
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||||
|
|
||||||
|
@ -56,7 +59,7 @@ public class CallsAudio extends SampleTest {
|
||||||
@LargeTest
|
@LargeTest
|
||||||
public void testCDTMFRFC2833InPCMUCall() {
|
public void testCDTMFRFC2833InPCMUCall() {
|
||||||
disableAllEnabledAudioCodecs();
|
disableAllEnabledAudioCodecs();
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_pcmu));
|
solo.clickOnText("PCMU");
|
||||||
goBackToDialerAfterCodecChanges();
|
goBackToDialerAfterCodecChanges();
|
||||||
solo.sleep(1000);
|
solo.sleep(1000);
|
||||||
|
|
||||||
|
@ -360,8 +363,11 @@ public class CallsAudio extends SampleTest {
|
||||||
solo.sleep(2000);
|
solo.sleep(2000);
|
||||||
LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
|
LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
|
||||||
|
|
||||||
if (call.getState() == LinphoneCall.State.OutgoingProgress) {
|
int retry = 0;
|
||||||
solo.sleep(3000);
|
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());
|
Assert.assertEquals(LinphoneCall.State.StreamsRunning, call.getState());
|
||||||
|
@ -395,72 +401,72 @@ public class CallsAudio extends SampleTest {
|
||||||
goToAudioCodecsSettings();
|
goToAudioCodecsSettings();
|
||||||
|
|
||||||
if (isAudioCodecEnabled("opus", 48000)) {
|
if (isAudioCodecEnabled("opus", 48000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_opus));
|
solo.clickOnText("opus");
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("speex", 16000)) {
|
if (isAudioCodecEnabled("speex", 16000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_speex16));
|
solo.clickOnText("speex");
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("speex", 8000)) {
|
if (isAudioCodecEnabled("speex", 8000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_speex8));
|
solo.clickOnText("speex", 1);
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("ilbc", 8000)) {
|
if (isAudioCodecEnabled("iLBC", 8000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_ilbc));
|
solo.clickOnText("iLBC");
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("AMR", 8000)) {
|
if (isAudioCodecEnabled("AMR", 8000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_amr));
|
solo.clickOnText("AMR");
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("AMRWB", 8000)) {
|
if (isAudioCodecEnabled("AMRWB", 8000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_amrwb));
|
solo.clickOnText("AMRWB");
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("G729", 8000)) {
|
if (isAudioCodecEnabled("G729", 8000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_g729));
|
solo.clickOnText("G729");
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("GSM", 8000)) {
|
if (isAudioCodecEnabled("GSM", 8000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_gsm));
|
solo.clickOnText("GSM");
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("G722", 8000)) {
|
if (isAudioCodecEnabled("G722", 8000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_g722));
|
solo.clickOnText("G722");
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("SILK", 24000)) {
|
if (isAudioCodecEnabled("SILK", 24000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_silk24));
|
solo.clickOnText("SILK");
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("SILK", 16000)) {
|
if (isAudioCodecEnabled("SILK", 16000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_silk16));
|
solo.clickOnText("SILK", 1);
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("SILK", 8000)) {
|
if (isAudioCodecEnabled("SILK", 8000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_silk8));
|
solo.clickOnText("SILK", 2);
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("PCMU", 8000)) {
|
if (isAudioCodecEnabled("PCMU", 8000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_pcmu));
|
solo.clickOnText("PCMU");
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("PCMA", 8000)) {
|
if (isAudioCodecEnabled("PCMA", 8000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_pcma));
|
solo.clickOnText("PCMA");
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import org.linphone.core.LinphoneCall;
|
||||||
import org.linphone.core.LinphoneCore;
|
import org.linphone.core.LinphoneCore;
|
||||||
import org.linphone.core.LinphoneCoreException;
|
import org.linphone.core.LinphoneCoreException;
|
||||||
import org.linphone.core.PayloadType;
|
import org.linphone.core.PayloadType;
|
||||||
|
import org.linphone.mediastream.Log;
|
||||||
|
|
||||||
import android.test.suitebuilder.annotation.LargeTest;
|
import android.test.suitebuilder.annotation.LargeTest;
|
||||||
import android.test.suitebuilder.annotation.MediumTest;
|
import android.test.suitebuilder.annotation.MediumTest;
|
||||||
|
@ -26,6 +27,8 @@ public class CallsVideo extends SampleTest {
|
||||||
@MediumTest
|
@MediumTest
|
||||||
@LargeTest
|
@LargeTest
|
||||||
public void testAInit() {
|
public void testAInit() {
|
||||||
|
LinphoneTestManager.getLc().enableVideo(true, true); // Just in case
|
||||||
|
|
||||||
//Disable video
|
//Disable video
|
||||||
goToSettings();
|
goToSettings();
|
||||||
|
|
||||||
|
@ -42,6 +45,8 @@ public class CallsVideo extends SampleTest {
|
||||||
@MediumTest
|
@MediumTest
|
||||||
@LargeTest
|
@LargeTest
|
||||||
public void testBOutgoingCallWithDefaultConfig() {
|
public void testBOutgoingCallWithDefaultConfig() {
|
||||||
|
LinphoneTestManager.getInstance().declineCall = false; // Just in case
|
||||||
|
|
||||||
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.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));
|
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||||
|
|
||||||
|
@ -205,6 +210,7 @@ public class CallsVideo extends SampleTest {
|
||||||
assertCallIsCorrectlyRunning();
|
assertCallIsCorrectlyRunning();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SmallTest
|
||||||
@MediumTest
|
@MediumTest
|
||||||
@LargeTest
|
@LargeTest
|
||||||
public void testJIncomingVideoCall() {
|
public void testJIncomingVideoCall() {
|
||||||
|
@ -306,11 +312,15 @@ public class CallsVideo extends SampleTest {
|
||||||
solo.sleep(2000);
|
solo.sleep(2000);
|
||||||
LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
|
LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
|
||||||
|
|
||||||
if (call.getState() == LinphoneCall.State.OutgoingProgress) {
|
int retry = 0;
|
||||||
solo.sleep(3000);
|
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());
|
Assert.assertEquals(LinphoneCall.State.StreamsRunning, call.getState());
|
||||||
|
Assert.assertTrue(call.getCurrentParamsCopy().getVideoEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void goToSettings() {
|
private void goToSettings() {
|
||||||
|
@ -352,75 +362,75 @@ public class CallsVideo extends SampleTest {
|
||||||
goToAudioCodecsSettings();
|
goToAudioCodecsSettings();
|
||||||
|
|
||||||
if (isAudioCodecEnabled("opus", 48000)) {
|
if (isAudioCodecEnabled("opus", 48000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_opus));
|
solo.clickOnText("opus");
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("speex", 16000)) {
|
if (isAudioCodecEnabled("speex", 16000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_speex16));
|
solo.clickOnText("speex");
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("speex", 8000)) {
|
if (isAudioCodecEnabled("speex", 8000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_speex8));
|
solo.clickOnText("speex", 1);
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("ilbc", 8000)) {
|
if (isAudioCodecEnabled("iLBC", 8000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_ilbc));
|
solo.clickOnText("iLBC");
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("AMR", 8000)) {
|
if (isAudioCodecEnabled("AMR", 8000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_amr));
|
solo.clickOnText("AMR");
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("AMRWB", 8000)) {
|
if (isAudioCodecEnabled("AMRWB", 8000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_amrwb));
|
solo.clickOnText("AMRWB");
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("G729", 8000)) {
|
if (isAudioCodecEnabled("G729", 8000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_g729));
|
solo.clickOnText("G729");
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("GSM", 8000)) {
|
if (isAudioCodecEnabled("GSM", 8000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_gsm));
|
solo.clickOnText("GSM");
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("G722", 8000)) {
|
if (isAudioCodecEnabled("G722", 8000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_g722));
|
solo.clickOnText("G722");
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("SILK", 24000)) {
|
if (isAudioCodecEnabled("SILK", 24000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_silk24));
|
solo.clickOnText("SILK");
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("SILK", 16000)) {
|
if (isAudioCodecEnabled("SILK", 16000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_silk16));
|
solo.clickOnText("SILK", 1);
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("SILK", 8000)) {
|
if (isAudioCodecEnabled("SILK", 8000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_silk8));
|
solo.clickOnText("SILK", 2);
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("PCMU", 8000)) {
|
if (isAudioCodecEnabled("PCMU", 8000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_pcmu));
|
solo.clickOnText("PCMU");
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAudioCodecEnabled("PCMA", 8000)) {
|
if (isAudioCodecEnabled("PCMA", 8000)) {
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.pref_codec_pcma));
|
solo.clickOnText("PCMA");
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isVideoCodecEnabled(String mime) {
|
private boolean isVideoCodecEnabled(String mime) {
|
||||||
LinphoneCore lc = LinphoneTestManager.getLc();
|
LinphoneCore lc = LinphoneTestManager.getLc();
|
||||||
|
|
|
@ -2,6 +2,7 @@ package org.linphone.test;
|
||||||
|
|
||||||
import junit.framework.Assert;
|
import junit.framework.Assert;
|
||||||
|
|
||||||
|
import org.linphone.ChatStorage;
|
||||||
import org.linphone.LinphoneActivity;
|
import org.linphone.LinphoneActivity;
|
||||||
import org.linphone.core.LinphoneChatMessage;
|
import org.linphone.core.LinphoneChatMessage;
|
||||||
import org.linphone.core.LinphoneChatMessage.State;
|
import org.linphone.core.LinphoneChatMessage.State;
|
||||||
|
@ -17,8 +18,22 @@ import android.test.suitebuilder.annotation.SmallTest;
|
||||||
*/
|
*/
|
||||||
public class Chat extends SampleTest {
|
public class Chat extends SampleTest {
|
||||||
|
|
||||||
|
@SmallTest
|
||||||
|
@MediumTest
|
||||||
@LargeTest
|
@LargeTest
|
||||||
public void testBEmptyChatHistory() {
|
public void testAEmptyChatHistory() {
|
||||||
|
goToChat();
|
||||||
|
|
||||||
|
ChatStorage chatStorage = ChatStorage.getInstance();
|
||||||
|
for (String conversation : chatStorage.getChatList()) {
|
||||||
|
chatStorage.removeDiscussion(conversation);
|
||||||
|
}
|
||||||
|
|
||||||
|
Assert.assertEquals(0, chatStorage.getUnreadMessageCount());
|
||||||
|
}
|
||||||
|
|
||||||
|
@LargeTest
|
||||||
|
public void testBDisplayEmptyChatHistory() {
|
||||||
goToChat();
|
goToChat();
|
||||||
|
|
||||||
Assert.assertTrue(solo.searchText(aContext.getString(org.linphone.R.string.no_chat_history)));
|
Assert.assertTrue(solo.searchText(aContext.getString(org.linphone.R.string.no_chat_history)));
|
||||||
|
@ -42,7 +57,7 @@ public class Chat extends SampleTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@LargeTest
|
@LargeTest
|
||||||
public void testDNotEmptyChatHistory() {
|
public void testDIsNotEmptyChatHistory() {
|
||||||
goToChat();
|
goToChat();
|
||||||
|
|
||||||
Assert.assertTrue(solo.searchText(iContext.getString(org.linphone.test.R.string.account_test_calls_login)));
|
Assert.assertTrue(solo.searchText(iContext.getString(org.linphone.test.R.string.account_test_calls_login)));
|
||||||
|
|
|
@ -11,6 +11,7 @@ import org.linphone.LinphoneManager;
|
||||||
import org.linphone.core.LinphoneCall;
|
import org.linphone.core.LinphoneCall;
|
||||||
import org.linphone.core.LinphoneCore.RegistrationState;
|
import org.linphone.core.LinphoneCore.RegistrationState;
|
||||||
import org.linphone.core.LinphoneCoreException;
|
import org.linphone.core.LinphoneCoreException;
|
||||||
|
import org.linphone.mediastream.Log;
|
||||||
|
|
||||||
import android.test.suitebuilder.annotation.LargeTest;
|
import android.test.suitebuilder.annotation.LargeTest;
|
||||||
import android.test.suitebuilder.annotation.MediumTest;
|
import android.test.suitebuilder.annotation.MediumTest;
|
||||||
|
@ -45,6 +46,7 @@ public class ConferenceAndMultiCall extends SampleTest {
|
||||||
@MediumTest
|
@MediumTest
|
||||||
@LargeTest
|
@LargeTest
|
||||||
public void testBSimpleConference() {
|
public void testBSimpleConference() {
|
||||||
|
LinphoneTestManager.getInstance().declineCall = false; // Just in case
|
||||||
startConference();
|
startConference();
|
||||||
|
|
||||||
solo.clickOnView(solo.getView(org.linphone.R.id.hangUp));
|
solo.clickOnView(solo.getView(org.linphone.R.id.hangUp));
|
||||||
|
@ -255,14 +257,13 @@ public class ConferenceAndMultiCall extends SampleTest {
|
||||||
private void startTwoCalls() {
|
private void startTwoCalls() {
|
||||||
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.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));
|
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||||
|
|
||||||
assertCallIsCorrectlyRunning(1);
|
assertCallIsCorrectlyRunning(1);
|
||||||
|
|
||||||
solo.clickOnView(solo.getView(org.linphone.R.id.options));
|
solo.clickOnView(solo.getView(org.linphone.R.id.options));
|
||||||
solo.clickOnView(solo.getView(org.linphone.R.id.addCall));
|
solo.clickOnView(solo.getView(org.linphone.R.id.addCall));
|
||||||
|
|
||||||
solo.enterText(0, iContext.getString(org.linphone.test.R.string.conference_account_login) + "@" + iContext.getString(org.linphone.test.R.string.conference_account_domain));
|
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));
|
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||||
|
|
||||||
assertCallIsCorrectlyRunning(2);
|
assertCallIsCorrectlyRunning(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,12 +281,16 @@ public class ConferenceAndMultiCall extends SampleTest {
|
||||||
private void assertCallIsCorrectlyRunning(int lcId) {
|
private void assertCallIsCorrectlyRunning(int lcId) {
|
||||||
solo.waitForActivity("InCallActivity", 5000);
|
solo.waitForActivity("InCallActivity", 5000);
|
||||||
solo.assertCurrentActivity("Expected InCall Activity", InCallActivity.class);
|
solo.assertCurrentActivity("Expected InCall Activity", InCallActivity.class);
|
||||||
|
|
||||||
solo.sleep(2000);
|
solo.sleep(2000);
|
||||||
|
Assert.assertEquals(1, LinphoneTestManager.getLc(lcId).getCallsNb());
|
||||||
LinphoneCall call = LinphoneTestManager.getLc(lcId).getCalls()[0];
|
LinphoneCall call = LinphoneTestManager.getLc(lcId).getCalls()[0];
|
||||||
|
|
||||||
if (call.getState() == LinphoneCall.State.OutgoingProgress || call.getState() == LinphoneCall.State.IncomingReceived) {
|
int retry = 0;
|
||||||
solo.sleep(3000);
|
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());
|
Assert.assertEquals(LinphoneCall.State.StreamsRunning, call.getState());
|
||||||
|
|
|
@ -20,6 +20,7 @@ import org.linphone.core.LinphoneCore.EcCalibratorStatus;
|
||||||
import org.linphone.core.LinphoneCore.GlobalState;
|
import org.linphone.core.LinphoneCore.GlobalState;
|
||||||
import org.linphone.core.LinphoneCore.MediaEncryption;
|
import org.linphone.core.LinphoneCore.MediaEncryption;
|
||||||
import org.linphone.core.LinphoneCore.RegistrationState;
|
import org.linphone.core.LinphoneCore.RegistrationState;
|
||||||
|
import org.linphone.core.LinphoneCore.Transports;
|
||||||
import org.linphone.core.LinphoneCoreException;
|
import org.linphone.core.LinphoneCoreException;
|
||||||
import org.linphone.core.LinphoneCoreFactory;
|
import org.linphone.core.LinphoneCoreFactory;
|
||||||
import org.linphone.core.LinphoneCoreListener;
|
import org.linphone.core.LinphoneCoreListener;
|
||||||
|
@ -37,15 +38,13 @@ import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
|
||||||
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration.AndroidCamera;
|
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration.AndroidCamera;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.IntentFilter;
|
|
||||||
import android.content.pm.PackageManager.NameNotFoundException;
|
import android.content.pm.PackageManager.NameNotFoundException;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
|
|
||||||
public class LinphoneTestManager implements LinphoneCoreListener {
|
public class LinphoneTestManager implements LinphoneCoreListener {
|
||||||
|
|
||||||
private static LinphoneTestManager instance;
|
private static LinphoneTestManager instance;
|
||||||
private Context mIContext;
|
private Context mAContext, mIContext;
|
||||||
private LinphoneCore mLc1, mLc2;
|
private LinphoneCore mLc1, mLc2;
|
||||||
|
|
||||||
public String lastMessageReceived;
|
public String lastMessageReceived;
|
||||||
|
@ -53,10 +52,12 @@ public class LinphoneTestManager implements LinphoneCoreListener {
|
||||||
public boolean autoAnswer = true;
|
public boolean autoAnswer = true;
|
||||||
public boolean declineCall = false;
|
public boolean declineCall = false;
|
||||||
|
|
||||||
private Timer mTimer = new Timer("Linphone scheduler");
|
private Timer mTimer1 = new Timer("Linphone scheduler 1");
|
||||||
|
private Timer mTimer2 = new Timer("Linphone scheduler 2");
|
||||||
|
|
||||||
private LinphoneTestManager(Context ac, Context ic) {
|
private LinphoneTestManager(Context ac, Context ic) {
|
||||||
mIContext = ic;
|
mIContext = ic;
|
||||||
|
mAContext = ac;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static LinphoneTestManager createAndStart(Context ac, Context ic, int id) {
|
public static LinphoneTestManager createAndStart(Context ac, Context ic, int id) {
|
||||||
|
@ -77,7 +78,8 @@ public class LinphoneTestManager implements LinphoneCoreListener {
|
||||||
try {
|
try {
|
||||||
LinphoneCoreFactory.instance().setDebugMode(true, "LinphoneTester");
|
LinphoneCoreFactory.instance().setDebugMode(true, "LinphoneTester");
|
||||||
|
|
||||||
final LinphoneCore mLc = LinphoneCoreFactory.instance().createLinphoneCore(this);
|
String basePath = mAContext.getFilesDir().getAbsolutePath();
|
||||||
|
final LinphoneCore mLc = LinphoneCoreFactory.instance().createLinphoneCore(this, basePath + "/.linphonerc" + id, null, null);
|
||||||
if (id == 2) {
|
if (id == 2) {
|
||||||
mLc2 = mLc;
|
mLc2 = mLc;
|
||||||
} else {
|
} else {
|
||||||
|
@ -114,11 +116,13 @@ public class LinphoneTestManager implements LinphoneCoreListener {
|
||||||
mLc.iterate();
|
mLc.iterate();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
mTimer.scheduleAtFixedRate(lTask, 0, 20);
|
|
||||||
|
|
||||||
IntentFilter lFilter = new IntentFilter(Intent.ACTION_SCREEN_ON);
|
|
||||||
lFilter.addAction(Intent.ACTION_SCREEN_OFF);
|
|
||||||
|
|
||||||
|
if (id == 2) {
|
||||||
|
mTimer2.scheduleAtFixedRate(lTask, 0, 20);
|
||||||
|
} else {
|
||||||
|
mTimer1.scheduleAtFixedRate(lTask, 0, 20);
|
||||||
|
}
|
||||||
|
|
||||||
resetCameraFromPreferences();
|
resetCameraFromPreferences();
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
|
@ -137,9 +141,18 @@ public class LinphoneTestManager implements LinphoneCoreListener {
|
||||||
LinphoneManager.getLc().setVideoDevice(camId);
|
LinphoneManager.getLc().setVideoDevice(camId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initFromConf(LinphoneCore mLc) throws LinphoneConfigException {
|
public void initFromConf(LinphoneCore mLc) throws LinphoneConfigException, LinphoneCoreException {
|
||||||
LinphoneCoreFactory.instance().setDebugMode(true, "LinphoneTester");
|
LinphoneCoreFactory.instance().setDebugMode(true, "LinphoneTester");
|
||||||
|
|
||||||
|
// Use TCP with Random port
|
||||||
|
Transports transports = getLc().getSignalingTransportPorts();
|
||||||
|
transports.tcp = -1;
|
||||||
|
transports.udp = 0;
|
||||||
|
transports.tls = 0;
|
||||||
|
mLc.setSignalingTransportPorts(transports);
|
||||||
|
|
||||||
|
initAccounts(mLc);
|
||||||
|
|
||||||
mLc.setVideoPolicy(true, true);
|
mLc.setVideoPolicy(true, true);
|
||||||
boolean isVideoEnabled = true;
|
boolean isVideoEnabled = true;
|
||||||
mLc.enableVideo(isVideoEnabled, isVideoEnabled);
|
mLc.enableVideo(isVideoEnabled, isVideoEnabled);
|
||||||
|
@ -169,7 +182,7 @@ public class LinphoneTestManager implements LinphoneCoreListener {
|
||||||
mLc.setMediaEncryption(me);
|
mLc.setMediaEncryption(me);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initAccounts(LinphoneCore mLc) throws LinphoneCoreException {
|
private void initAccounts(LinphoneCore mLc) throws LinphoneCoreException {
|
||||||
mLc.clearAuthInfos();
|
mLc.clearAuthInfos();
|
||||||
mLc.clearProxyConfigs();
|
mLc.clearProxyConfigs();
|
||||||
|
|
||||||
|
@ -183,7 +196,7 @@ public class LinphoneTestManager implements LinphoneCoreListener {
|
||||||
password = mIContext.getString(org.linphone.test.R.string.conference_account_password);
|
password = mIContext.getString(org.linphone.test.R.string.conference_account_password);
|
||||||
domain = mIContext.getString(org.linphone.test.R.string.conference_account_domain);
|
domain = mIContext.getString(org.linphone.test.R.string.conference_account_domain);
|
||||||
}
|
}
|
||||||
LinphoneAuthInfo lAuthInfo = LinphoneCoreFactory.instance().createAuthInfo(username, password, null);
|
LinphoneAuthInfo lAuthInfo = LinphoneCoreFactory.instance().createAuthInfo(username, password, null, domain);
|
||||||
mLc.addAuthInfo(lAuthInfo);
|
mLc.addAuthInfo(lAuthInfo);
|
||||||
String identity = "sip:" + username +"@" + domain;
|
String identity = "sip:" + username +"@" + domain;
|
||||||
String proxy = "sip:" + domain;
|
String proxy = "sip:" + domain;
|
||||||
|
@ -243,7 +256,8 @@ public class LinphoneTestManager implements LinphoneCoreListener {
|
||||||
|
|
||||||
private void doDestroy() {
|
private void doDestroy() {
|
||||||
try {
|
try {
|
||||||
mTimer.cancel();
|
mTimer1.cancel();
|
||||||
|
mTimer2.cancel();
|
||||||
mLc1.destroy();
|
mLc1.destroy();
|
||||||
mLc2.destroy();
|
mLc2.destroy();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package org.linphone.test;
|
||||||
|
|
||||||
import org.linphone.LinphoneLauncherActivity;
|
import org.linphone.LinphoneLauncherActivity;
|
||||||
import org.linphone.LinphoneManager;
|
import org.linphone.LinphoneManager;
|
||||||
|
import org.linphone.core.LinphoneCore;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.test.ActivityInstrumentationTestCase2;
|
import android.test.ActivityInstrumentationTestCase2;
|
||||||
|
@ -32,7 +33,10 @@ public abstract class SampleTest extends ActivityInstrumentationTestCase2<Linpho
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tearDown() throws Exception {
|
public void tearDown() throws Exception {
|
||||||
LinphoneManager.getLcIfManagerNotDestroyedOrNull().terminateAllCalls();
|
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
||||||
|
if (lc != null) {
|
||||||
|
lc.terminateAllCalls();
|
||||||
|
}
|
||||||
solo.finishOpenedActivities();
|
solo.finishOpenedActivities();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue