Some more fixes for basic tests: all of them are now passing
This commit is contained in:
parent
2d28121e0e
commit
e5c069c58e
3 changed files with 25 additions and 1 deletions
|
@ -57,7 +57,17 @@ public class ContactsFragment extends Fragment implements OnClickListener, OnIte
|
||||||
private AlphabetIndexer indexer;
|
private AlphabetIndexer indexer;
|
||||||
private boolean editOnClick = false, editConsumed = false, onlyDisplayChatAddress = false;
|
private boolean editOnClick = false, editConsumed = false, onlyDisplayChatAddress = false;
|
||||||
private String sipAddressToAdd;
|
private String sipAddressToAdd;
|
||||||
|
|
||||||
|
private static ContactsFragment instance;
|
||||||
|
|
||||||
|
static final boolean isInstanciated() {
|
||||||
|
return instance != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final ContactsFragment instance() {
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
|
@ -166,6 +176,7 @@ public class ContactsFragment extends Fragment implements OnClickListener, OnIte
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
|
instance = this;
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
if (editConsumed) {
|
if (editConsumed) {
|
||||||
|
@ -181,6 +192,12 @@ public class ContactsFragment extends Fragment implements OnClickListener, OnIte
|
||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
instance = null;
|
||||||
|
super.onPause();
|
||||||
|
}
|
||||||
|
|
||||||
public void invalidate() {
|
public void invalidate() {
|
||||||
mHandler.post(new Runnable() {
|
mHandler.post(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -27,7 +27,6 @@ public class CallsVideo extends SampleTest {
|
||||||
@MediumTest
|
@MediumTest
|
||||||
@LargeTest
|
@LargeTest
|
||||||
public void testAInit() {
|
public void testAInit() {
|
||||||
|
|
||||||
//Enable video
|
//Enable video
|
||||||
goToSettings();
|
goToSettings();
|
||||||
|
|
||||||
|
@ -46,6 +45,8 @@ public class CallsVideo extends SampleTest {
|
||||||
solo.goBack();
|
solo.goBack();
|
||||||
solo.sleep(1000);
|
solo.sleep(1000);
|
||||||
Assert.assertTrue(LinphoneManager.getLc().isVideoEnabled());
|
Assert.assertTrue(LinphoneManager.getLc().isVideoEnabled());
|
||||||
|
Assert.assertTrue(LinphoneManager.getLc().getVideoAutoAcceptPolicy());
|
||||||
|
Assert.assertTrue(LinphoneManager.getLc().getVideoAutoInitiatePolicy());
|
||||||
}
|
}
|
||||||
|
|
||||||
@SmallTest
|
@SmallTest
|
||||||
|
@ -53,6 +54,7 @@ public class CallsVideo extends SampleTest {
|
||||||
@LargeTest
|
@LargeTest
|
||||||
public void testBOutgoingCallWithDefaultConfig() {
|
public void testBOutgoingCallWithDefaultConfig() {
|
||||||
LinphoneTestManager.getInstance().declineCall = false; // Just in case
|
LinphoneTestManager.getInstance().declineCall = false; // Just in case
|
||||||
|
LinphoneTestManager.getLc().enableVideo(true, true);
|
||||||
|
|
||||||
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));
|
||||||
|
|
|
@ -2,6 +2,7 @@ package org.linphone.test;
|
||||||
|
|
||||||
import junit.framework.Assert;
|
import junit.framework.Assert;
|
||||||
|
|
||||||
|
import org.linphone.ContactsFragment;
|
||||||
import org.linphone.LinphoneActivity;
|
import org.linphone.LinphoneActivity;
|
||||||
|
|
||||||
import android.test.suitebuilder.annotation.LargeTest;
|
import android.test.suitebuilder.annotation.LargeTest;
|
||||||
|
@ -50,6 +51,10 @@ public class Contacts extends SampleTest {
|
||||||
solo.enterText(2, iContext.getString(org.linphone.test.R.string.contact_number));
|
solo.enterText(2, iContext.getString(org.linphone.test.R.string.contact_number));
|
||||||
solo.clickOnText(aContext.getString(org.linphone.R.string.button_ok));
|
solo.clickOnText(aContext.getString(org.linphone.R.string.button_ok));
|
||||||
|
|
||||||
|
if (ContactsFragment.instance() != null) {
|
||||||
|
ContactsFragment.instance().invalidate();
|
||||||
|
solo.sleep(1000);
|
||||||
|
}
|
||||||
Assert.assertTrue(solo.searchText(iContext.getString(org.linphone.test.R.string.contact_name)));
|
Assert.assertTrue(solo.searchText(iContext.getString(org.linphone.test.R.string.contact_name)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue