Quick fixes for account setup unit tests
Some of these broke in 8bcb572ccf
which changed the [Next] button to an ActionBar menu item.
However, the entirety of AccountSettingsXLTests needed to be disabled
because the PreferenceActivity is very different on phone or XL sized
devices, and the tests infrastructure will need to be refactored to deal
with that (on another day.)
Change-Id: I9adbfc9b8da6179e4c4e82d29bb872ee05619a41
This commit is contained in:
parent
db746428ef
commit
4c3a8ede01
@ -70,7 +70,7 @@ public class AccountSetupExchange extends AccountSetupActivity
|
||||
implements AccountSetupExchangeFragment.Callback {
|
||||
|
||||
/* package */ AccountSetupExchangeFragment mFragment;
|
||||
private boolean mNextButtonEnabled;
|
||||
/* package */ boolean mNextButtonEnabled;
|
||||
|
||||
public static void actionIncomingSettings(Activity fromActivity, int mode, Account acct) {
|
||||
SetupData.init(mode, acct);
|
||||
|
@ -27,7 +27,7 @@ public class AccountSetupIncoming extends AccountSetupActivity
|
||||
implements AccountSetupIncomingFragment.Callback {
|
||||
|
||||
private AccountSetupIncomingFragment mFragment;
|
||||
private boolean mNextButtonEnabled;
|
||||
/* package */ boolean mNextButtonEnabled;
|
||||
|
||||
public static void actionIncomingSettings(Activity fromActivity, int mode,
|
||||
EmailContent.Account account) {
|
||||
|
@ -28,7 +28,7 @@ public class AccountSetupOutgoing extends Activity
|
||||
implements AccountSetupOutgoingFragment.Callback {
|
||||
|
||||
private AccountSetupOutgoingFragment mFragment;
|
||||
private boolean mNextButtonEnabled;
|
||||
/* package */ boolean mNextButtonEnabled;
|
||||
|
||||
public static void actionOutgoingSettings(Activity fromActivity, int mode, Account acct) {
|
||||
SetupData.init(mode, acct);
|
||||
|
@ -32,6 +32,8 @@ import android.test.suitebuilder.annotation.MediumTest;
|
||||
* Tests of basic UI logic in the Account Settings fragment.
|
||||
*
|
||||
* TODO: This should use a local provider for the test "accounts", and not touch user data
|
||||
* TODO: These cannot run in the single-pane mode, and need to be refactored into single-pane
|
||||
* and multi-pane versions. Until then, they are all disabled.
|
||||
*
|
||||
* To execute: runtest -c com.android.email.activity.setup.AccountSettingsXLTests email
|
||||
*/
|
||||
@ -77,7 +79,7 @@ public class AccountSettingsXLTests extends ActivityInstrumentationTestCase2<Acc
|
||||
/**
|
||||
* Test that POP accounts aren't displayed with a push option
|
||||
*/
|
||||
public void testPushOptionPOP() throws Throwable {
|
||||
public void disable_testPushOptionPOP() throws Throwable {
|
||||
Intent i = getTestIntent("Name", "pop3://user:password@server.com",
|
||||
"smtp://user:password@server.com");
|
||||
this.setActivityIntent(i);
|
||||
@ -91,7 +93,7 @@ public class AccountSettingsXLTests extends ActivityInstrumentationTestCase2<Acc
|
||||
/**
|
||||
* Test that IMAP accounts aren't displayed with a push option
|
||||
*/
|
||||
public void testPushOptionIMAP() throws Throwable {
|
||||
public void disable_testPushOptionIMAP() throws Throwable {
|
||||
Intent i = getTestIntent("Name", "imap://user:password@server.com",
|
||||
"smtp://user:password@server.com");
|
||||
this.setActivityIntent(i);
|
||||
@ -105,7 +107,7 @@ public class AccountSettingsXLTests extends ActivityInstrumentationTestCase2<Acc
|
||||
/**
|
||||
* Test that EAS accounts are displayed with a push option
|
||||
*/
|
||||
public void testPushOptionEAS() throws Throwable {
|
||||
public void disable_testPushOptionEAS() throws Throwable {
|
||||
// This test should only be run if EAS is supported
|
||||
if (Store.StoreInfo.getStoreInfo("eas", this.getInstrumentation().getTargetContext())
|
||||
== null) {
|
||||
|
@ -27,7 +27,6 @@ import android.test.ActivityInstrumentationTestCase2;
|
||||
import android.test.UiThreadTest;
|
||||
import android.test.suitebuilder.annotation.MediumTest;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.EditText;
|
||||
|
||||
@ -42,7 +41,6 @@ public class AccountSetupExchangeTests extends
|
||||
//EXCHANGE-REMOVE-SECTION-START
|
||||
private AccountSetupExchange mActivity;
|
||||
private EditText mServerView;
|
||||
private Button mNextButton;
|
||||
private CheckBox mSslRequiredCheckbox;
|
||||
private CheckBox mTrustAllCertificatesCheckbox;
|
||||
//EXCHANGE-REMOVE-SECTION-END
|
||||
@ -74,7 +72,7 @@ public class AccountSetupExchangeTests extends
|
||||
Intent i = getTestIntent("eas://user:password@server.com");
|
||||
setActivityIntent(i);
|
||||
getActivityAndFields();
|
||||
assertTrue(mNextButton.isEnabled());
|
||||
assertTrue(mActivity.mNextButtonEnabled);
|
||||
}
|
||||
|
||||
// TODO Add tests for valid usernames in eas
|
||||
@ -87,7 +85,7 @@ public class AccountSetupExchangeTests extends
|
||||
Intent i = getTestIntent("eas://:password@server.com");
|
||||
setActivityIntent(i);
|
||||
getActivityAndFields();
|
||||
assertFalse(mNextButton.isEnabled());
|
||||
assertFalse(mActivity.mNextButtonEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -97,7 +95,7 @@ public class AccountSetupExchangeTests extends
|
||||
Intent i = getTestIntent("eas://user@server.com");
|
||||
setActivityIntent(i);
|
||||
getActivityAndFields();
|
||||
assertFalse(mNextButton.isEnabled());
|
||||
assertFalse(mActivity.mNextButtonEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -106,10 +104,10 @@ public class AccountSetupExchangeTests extends
|
||||
@UiThreadTest
|
||||
public void testGoodServerVariants() {
|
||||
getActivityAndFields();
|
||||
assertTrue(mNextButton.isEnabled());
|
||||
assertTrue(mActivity.mNextButtonEnabled);
|
||||
|
||||
mServerView.setText(" server.com ");
|
||||
assertTrue(mNextButton.isEnabled());
|
||||
assertTrue(mActivity.mNextButtonEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -118,13 +116,13 @@ public class AccountSetupExchangeTests extends
|
||||
@UiThreadTest
|
||||
public void testBadServerVariants() {
|
||||
getActivityAndFields();
|
||||
assertTrue(mNextButton.isEnabled());
|
||||
assertTrue(mActivity.mNextButtonEnabled);
|
||||
|
||||
mServerView.setText(" ");
|
||||
assertFalse(mNextButton.isEnabled());
|
||||
assertFalse(mActivity.mNextButtonEnabled);
|
||||
|
||||
mServerView.setText("serv$er.com");
|
||||
assertFalse(mNextButton.isEnabled());
|
||||
assertFalse(mActivity.mNextButtonEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -179,7 +177,6 @@ public class AccountSetupExchangeTests extends
|
||||
private void getActivityAndFields() {
|
||||
mActivity = getActivity();
|
||||
mServerView = (EditText) mActivity.findViewById(R.id.account_server);
|
||||
mNextButton = (Button) mActivity.findViewById(R.id.next);
|
||||
mSslRequiredCheckbox = (CheckBox) mActivity.findViewById(R.id.account_ssl);
|
||||
mTrustAllCertificatesCheckbox =
|
||||
(CheckBox) mActivity.findViewById(R.id.account_trust_certificates);
|
||||
|
@ -23,7 +23,6 @@ import android.content.Intent;
|
||||
import android.test.ActivityInstrumentationTestCase2;
|
||||
import android.test.UiThreadTest;
|
||||
import android.test.suitebuilder.annotation.MediumTest;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
|
||||
/**
|
||||
@ -37,7 +36,6 @@ public class AccountSetupIncomingTests extends
|
||||
|
||||
private AccountSetupIncoming mActivity;
|
||||
private EditText mServerView;
|
||||
private Button mNextButton;
|
||||
|
||||
public AccountSetupIncomingTests() {
|
||||
super(AccountSetupIncoming.class);
|
||||
@ -65,7 +63,7 @@ public class AccountSetupIncomingTests extends
|
||||
Intent i = getTestIntent("imap://user:password@server.com:999");
|
||||
setActivityIntent(i);
|
||||
getActivityAndFields();
|
||||
assertTrue(mNextButton.isEnabled());
|
||||
assertTrue(mActivity.mNextButtonEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -75,7 +73,7 @@ public class AccountSetupIncomingTests extends
|
||||
Intent i = getTestIntent("imap://:password@server.com:999");
|
||||
setActivityIntent(i);
|
||||
getActivityAndFields();
|
||||
assertFalse(mNextButton.isEnabled());
|
||||
assertFalse(mActivity.mNextButtonEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -85,7 +83,7 @@ public class AccountSetupIncomingTests extends
|
||||
Intent i = getTestIntent("imap://user@server.com:999");
|
||||
setActivityIntent(i);
|
||||
getActivityAndFields();
|
||||
assertFalse(mNextButton.isEnabled());
|
||||
assertFalse(mActivity.mNextButtonEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -95,7 +93,7 @@ public class AccountSetupIncomingTests extends
|
||||
Intent i = getTestIntent("imap://user:password@server.com");
|
||||
setActivityIntent(i);
|
||||
getActivityAndFields();
|
||||
assertTrue(mNextButton.isEnabled());
|
||||
assertTrue(mActivity.mNextButtonEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -104,10 +102,10 @@ public class AccountSetupIncomingTests extends
|
||||
@UiThreadTest
|
||||
public void testGoodServerVariants() {
|
||||
getActivityAndFields();
|
||||
assertTrue(mNextButton.isEnabled());
|
||||
assertTrue(mActivity.mNextButtonEnabled);
|
||||
|
||||
mServerView.setText(" server.com ");
|
||||
assertTrue(mNextButton.isEnabled());
|
||||
assertTrue(mActivity.mNextButtonEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -116,13 +114,13 @@ public class AccountSetupIncomingTests extends
|
||||
@UiThreadTest
|
||||
public void testBadServerVariants() {
|
||||
getActivityAndFields();
|
||||
assertTrue(mNextButton.isEnabled());
|
||||
assertTrue(mActivity.mNextButtonEnabled);
|
||||
|
||||
mServerView.setText(" ");
|
||||
assertFalse(mNextButton.isEnabled());
|
||||
assertFalse(mActivity.mNextButtonEnabled);
|
||||
|
||||
mServerView.setText("serv$er.com");
|
||||
assertFalse(mNextButton.isEnabled());
|
||||
assertFalse(mActivity.mNextButtonEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -136,7 +134,6 @@ public class AccountSetupIncomingTests extends
|
||||
private void getActivityAndFields() {
|
||||
mActivity = getActivity();
|
||||
mServerView = (EditText) mActivity.findViewById(R.id.account_server);
|
||||
mNextButton = (Button) mActivity.findViewById(R.id.next);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -23,7 +23,6 @@ import android.content.Intent;
|
||||
import android.test.ActivityInstrumentationTestCase2;
|
||||
import android.test.UiThreadTest;
|
||||
import android.test.suitebuilder.annotation.MediumTest;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
|
||||
/**
|
||||
@ -37,7 +36,6 @@ public class AccountSetupOutgoingTests extends
|
||||
|
||||
private AccountSetupOutgoing mActivity;
|
||||
private EditText mServerView;
|
||||
private Button mNextButton;
|
||||
|
||||
public AccountSetupOutgoingTests() {
|
||||
super(AccountSetupOutgoing.class);
|
||||
@ -63,7 +61,7 @@ public class AccountSetupOutgoingTests extends
|
||||
*/
|
||||
public void testGoodUri() {
|
||||
getActivityAndFields();
|
||||
assertTrue(mNextButton.isEnabled());
|
||||
assertTrue(mActivity.mNextButtonEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -73,7 +71,7 @@ public class AccountSetupOutgoingTests extends
|
||||
Intent i = getTestIntent("smtp://:password@server.com:999");
|
||||
setActivityIntent(i);
|
||||
getActivityAndFields();
|
||||
assertFalse(mNextButton.isEnabled());
|
||||
assertFalse(mActivity.mNextButtonEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -83,7 +81,7 @@ public class AccountSetupOutgoingTests extends
|
||||
Intent i = getTestIntent("smtp://user@server.com:999");
|
||||
setActivityIntent(i);
|
||||
getActivityAndFields();
|
||||
assertFalse(mNextButton.isEnabled());
|
||||
assertFalse(mActivity.mNextButtonEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -93,7 +91,7 @@ public class AccountSetupOutgoingTests extends
|
||||
Intent i = getTestIntent("smtp://user:password@server.com");
|
||||
setActivityIntent(i);
|
||||
getActivityAndFields();
|
||||
assertTrue(mNextButton.isEnabled());
|
||||
assertTrue(mActivity.mNextButtonEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -102,10 +100,10 @@ public class AccountSetupOutgoingTests extends
|
||||
@UiThreadTest
|
||||
public void testGoodServerVariants() {
|
||||
getActivityAndFields();
|
||||
assertTrue(mNextButton.isEnabled());
|
||||
assertTrue(mActivity.mNextButtonEnabled);
|
||||
|
||||
mServerView.setText(" server.com ");
|
||||
assertTrue(mNextButton.isEnabled());
|
||||
assertTrue(mActivity.mNextButtonEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -114,13 +112,13 @@ public class AccountSetupOutgoingTests extends
|
||||
@UiThreadTest
|
||||
public void testBadServerVariants() {
|
||||
getActivityAndFields();
|
||||
assertTrue(mNextButton.isEnabled());
|
||||
assertTrue(mActivity.mNextButtonEnabled);
|
||||
|
||||
mServerView.setText(" ");
|
||||
assertFalse(mNextButton.isEnabled());
|
||||
assertFalse(mActivity.mNextButtonEnabled);
|
||||
|
||||
mServerView.setText("serv$er.com");
|
||||
assertFalse(mNextButton.isEnabled());
|
||||
assertFalse(mActivity.mNextButtonEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -133,7 +131,6 @@ public class AccountSetupOutgoingTests extends
|
||||
private void getActivityAndFields() {
|
||||
mActivity = getActivity();
|
||||
mServerView = (EditText) mActivity.findViewById(R.id.account_server);
|
||||
mNextButton = (Button) mActivity.findViewById(R.id.next);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user