Outgoing calls (audio/video) with every codec tests added
This commit is contained in:
parent
b8d4815da6
commit
045d0d5e1b
4 changed files with 99 additions and 57 deletions
|
@ -21,6 +21,7 @@ auto_net_state_mon=0
|
||||||
keepalive_period=30000
|
keepalive_period=30000
|
||||||
auto_answer_replacing_calls=1
|
auto_answer_replacing_calls=1
|
||||||
media_encryption_mandatory=0
|
media_encryption_mandatory=0
|
||||||
|
ping_with_options=0
|
||||||
|
|
||||||
[rtp]
|
[rtp]
|
||||||
audio_rtp_port=7076
|
audio_rtp_port=7076
|
||||||
|
|
|
@ -15,12 +15,12 @@ import android.widget.ListView;
|
||||||
|
|
||||||
import com.jayway.android.robotium.solo.Solo;
|
import com.jayway.android.robotium.solo.Solo;
|
||||||
|
|
||||||
public class AudioCodecsTest extends ActivityInstrumentationTestCase2<LinphoneActivity> {
|
public class AudioAndVideoCodecsTest extends ActivityInstrumentationTestCase2<LinphoneActivity> {
|
||||||
|
private static final String sipAdressToCall = "miaou@sip.linphone.org";
|
||||||
private Solo solo;
|
private Solo solo;
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public AudioCodecsTest() {
|
public AudioAndVideoCodecsTest() {
|
||||||
super("org.linphone", LinphoneActivity.class);
|
super("org.linphone", LinphoneActivity.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,6 +53,19 @@ public class AudioCodecsTest extends ActivityInstrumentationTestCase2<LinphoneAc
|
||||||
solo.sleep(500);
|
solo.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void goToVideoCodecsSettings() {
|
||||||
|
Context context = getActivity();
|
||||||
|
|
||||||
|
solo.waitForActivity("LinphoneActivity", 2000);
|
||||||
|
solo.assertCurrentActivity("Expected Linphone Activity", LinphoneActivity.class);
|
||||||
|
solo.clickOnView(solo.getView(R.id.settings));
|
||||||
|
|
||||||
|
solo.sleep(500);
|
||||||
|
selectItemInListOnUIThread(14);
|
||||||
|
solo.clickOnText(context.getString(R.string.pref_video_codecs_title), 2); //Hack: since pref_codecs = pref_video_codecs_title, we have to select the 2nd button
|
||||||
|
solo.sleep(500);
|
||||||
|
}
|
||||||
|
|
||||||
private void disableAllEnabledAudioCodecs() {
|
private void disableAllEnabledAudioCodecs() {
|
||||||
Context context = getActivity();
|
Context context = getActivity();
|
||||||
|
|
||||||
|
@ -110,10 +123,32 @@ public class AudioCodecsTest extends ActivityInstrumentationTestCase2<LinphoneAc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void disableAllEnabledVideoCodecs() {
|
||||||
|
Context context = getActivity();
|
||||||
|
|
||||||
|
goToVideoCodecsSettings();
|
||||||
|
|
||||||
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
if (prefs.getBoolean(context.getString(R.string.pref_video_codec_vp8_key), false)) {
|
||||||
|
solo.clickOnText(context.getString(R.string.pref_video_codec_vp8_title));
|
||||||
|
solo.sleep(500);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (prefs.getBoolean(context.getString(R.string.pref_video_codec_h264_key), false)) {
|
||||||
|
solo.clickOnText(context.getString(R.string.pref_video_codec_h264_title));
|
||||||
|
solo.sleep(500);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (prefs.getBoolean(context.getString(R.string.pref_video_codec_mpeg4_key), false)) {
|
||||||
|
solo.clickOnText(context.getString(R.string.pref_video_codec_mpeg4_title));
|
||||||
|
solo.sleep(500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void goToDialerAndOutgoingCall(String codecTextToAssert) {
|
private void goToDialerAndOutgoingCall(String codecTextToAssert) {
|
||||||
solo.clickOnView(solo.getView(R.id.dialer));
|
solo.clickOnView(solo.getView(R.id.dialer));
|
||||||
solo.clickOnView(solo.getView(R.id.Adress));
|
solo.clickOnView(solo.getView(R.id.Adress));
|
||||||
solo.enterText((EditText) solo.getView(R.id.Adress), "cotcot@sip.linphone.org");
|
solo.enterText((EditText) solo.getView(R.id.Adress), sipAdressToCall);
|
||||||
solo.clickOnView(solo.getView(R.id.Call));
|
solo.clickOnView(solo.getView(R.id.Call));
|
||||||
|
|
||||||
solo.waitForActivity("InCallActivity", 2000);
|
solo.waitForActivity("InCallActivity", 2000);
|
||||||
|
@ -215,15 +250,6 @@ public class AudioCodecsTest extends ActivityInstrumentationTestCase2<LinphoneAc
|
||||||
goToDialerAndOutgoingCall("iLBC");
|
goToDialerAndOutgoingCall("iLBC");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKOutgoingAudioCallSpeex16() {
|
|
||||||
Context context = getActivity();
|
|
||||||
disableAllEnabledAudioCodecs();
|
|
||||||
solo.clickOnText(context.getString(R.string.pref_codec_speex16));
|
|
||||||
solo.goBack();
|
|
||||||
|
|
||||||
goToDialerAndOutgoingCall("speex");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testJOutgoingAudioCallSpeex8() {
|
public void testJOutgoingAudioCallSpeex8() {
|
||||||
Context context = getActivity();
|
Context context = getActivity();
|
||||||
disableAllEnabledAudioCodecs();
|
disableAllEnabledAudioCodecs();
|
||||||
|
@ -233,8 +259,63 @@ public class AudioCodecsTest extends ActivityInstrumentationTestCase2<LinphoneAc
|
||||||
goToDialerAndOutgoingCall("speex");
|
goToDialerAndOutgoingCall("speex");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testKOutgoingAudioCallSpeex16() {
|
||||||
|
Context context = getActivity();
|
||||||
|
disableAllEnabledAudioCodecs();
|
||||||
|
solo.clickOnText(context.getString(R.string.pref_codec_speex16));
|
||||||
|
solo.goBack();
|
||||||
|
|
||||||
|
goToDialerAndOutgoingCall("speex");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testLEnableVideo() {
|
||||||
|
Context context = getActivity();
|
||||||
|
|
||||||
|
solo.waitForActivity("LinphoneActivity", 2000);
|
||||||
|
solo.assertCurrentActivity("Expected Linphone Activity", LinphoneActivity.class);
|
||||||
|
solo.clickOnView(solo.getView(R.id.settings));
|
||||||
|
|
||||||
|
solo.sleep(500);
|
||||||
|
selectItemInListOnUIThread(4);
|
||||||
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
if (!prefs.getBoolean(context.getString(R.string.pref_video_enable_key), true)) {
|
||||||
|
solo.clickOnText(context.getString(R.string.pref_video_enable_title));
|
||||||
|
solo.sleep(500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testMOutgoingVideoCallVP8() {
|
||||||
|
Context context = getActivity();
|
||||||
|
disableAllEnabledVideoCodecs();
|
||||||
|
solo.clickOnText(context.getString(R.string.pref_video_codec_vp8_title));
|
||||||
|
solo.goBack();
|
||||||
|
|
||||||
|
goToDialerAndOutgoingCall("VP8");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testNOutgoingVideoCallH264() {
|
||||||
|
Context context = getActivity();
|
||||||
|
disableAllEnabledVideoCodecs();
|
||||||
|
solo.clickOnText(context.getString(R.string.pref_video_codec_h264_title));
|
||||||
|
solo.goBack();
|
||||||
|
|
||||||
|
goToDialerAndOutgoingCall("H264");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testOOutgoingVideoCallMPG4() {
|
||||||
|
Context context = getActivity();
|
||||||
|
disableAllEnabledVideoCodecs();
|
||||||
|
solo.clickOnText(context.getString(R.string.pref_video_codec_mpeg4_title));
|
||||||
|
solo.goBack();
|
||||||
|
|
||||||
|
goToDialerAndOutgoingCall("MP4V-ES");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tearDown() throws Exception {
|
public void tearDown() throws Exception {
|
||||||
|
if (solo.getCurrentActivity().getClass() == InCallActivity.class) {
|
||||||
|
solo.clickOnView(solo.getView(R.id.hangUp));
|
||||||
|
}
|
||||||
solo.finishOpenedActivities();
|
solo.finishOpenedActivities();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -4,6 +4,7 @@ import junit.framework.Assert;
|
||||||
|
|
||||||
import org.linphone.InCallActivity;
|
import org.linphone.InCallActivity;
|
||||||
import org.linphone.LinphoneActivity;
|
import org.linphone.LinphoneActivity;
|
||||||
|
import org.linphone.LinphoneManager;
|
||||||
import org.linphone.R;
|
import org.linphone.R;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
@ -36,6 +37,9 @@ public class HistoryTest extends ActivityInstrumentationTestCase2<LinphoneActivi
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
solo = new Solo(getInstrumentation(), getActivity());
|
solo = new Solo(getInstrumentation(), getActivity());
|
||||||
|
|
||||||
|
//Depending on previous tests, history may not be empty
|
||||||
|
LinphoneManager.getLc().clearCallLogs();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testADisplayEmptyHistory() {
|
public void testADisplayEmptyHistory() {
|
||||||
|
|
|
@ -1,44 +0,0 @@
|
||||||
package org.linphone.test;
|
|
||||||
|
|
||||||
import org.linphone.InCallActivity;
|
|
||||||
import org.linphone.LinphoneActivity;
|
|
||||||
import org.linphone.R;
|
|
||||||
|
|
||||||
import android.test.ActivityInstrumentationTestCase2;
|
|
||||||
import android.widget.EditText;
|
|
||||||
|
|
||||||
import com.jayway.android.robotium.solo.Solo;
|
|
||||||
|
|
||||||
public class OutgoingCallTest extends
|
|
||||||
ActivityInstrumentationTestCase2<LinphoneActivity> {
|
|
||||||
|
|
||||||
private Solo solo;
|
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public OutgoingCallTest() {
|
|
||||||
super("org.linphone", LinphoneActivity.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
solo = new Solo(getInstrumentation(), getActivity());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testOutgoingCallToCotcot() {
|
|
||||||
solo.assertCurrentActivity("Expected Linphone Activity", LinphoneActivity.class);
|
|
||||||
|
|
||||||
solo.clickOnView(solo.getView(R.id.Adress));
|
|
||||||
solo.enterText((EditText) solo.getView(R.id.Adress), "cotcot@sip.linphone.org");
|
|
||||||
solo.clickOnView(solo.getView(R.id.Call));
|
|
||||||
|
|
||||||
solo.assertCurrentActivity("Expected InCall Activity", InCallActivity.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void tearDown() throws Exception {
|
|
||||||
solo.clickOnView(solo.getView(R.id.hangUp));
|
|
||||||
solo.waitForActivity("LinphoneActivity", 2000);
|
|
||||||
solo.finishOpenedActivities();
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue