Fix account setup test
Change-Id: I7c1b785e5aa29cc7f47920d857441f1a09f05b21
This commit is contained in:
parent
0962a44fc4
commit
ad94ecc471
@ -25,10 +25,6 @@ import com.android.emailcommon.provider.HostAuth;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
// FLAG:
|
|
||||||
// * need to handle adding new authentication
|
|
||||||
// * need to handle a set, but invalid, OAuth info
|
|
||||||
|
|
||||||
public class AuthenticationView extends LinearLayout implements HostCallback, OnClickListener {
|
public class AuthenticationView extends LinearLayout implements HostCallback, OnClickListener {
|
||||||
|
|
||||||
private final static String SUPER_STATE = "super_state";
|
private final static String SUPER_STATE = "super_state";
|
||||||
@ -139,6 +135,10 @@ public class AuthenticationView extends LinearLayout implements HostCallback, On
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setPassword(final String password) {
|
||||||
|
getPasswordEditText().setText(password);
|
||||||
|
}
|
||||||
|
|
||||||
public String getPassword() {
|
public String getPassword() {
|
||||||
return getPasswordEditText().getText().toString();
|
return getPasswordEditText().getText().toString();
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ import android.widget.EditText;
|
|||||||
import com.android.email.R;
|
import com.android.email.R;
|
||||||
import com.android.email.activity.setup.AccountSetupIncoming;
|
import com.android.email.activity.setup.AccountSetupIncoming;
|
||||||
import com.android.email.activity.setup.AccountSetupIncomingFragment;
|
import com.android.email.activity.setup.AccountSetupIncomingFragment;
|
||||||
|
import com.android.email.activity.setup.AuthenticationView;
|
||||||
import com.android.email.activity.setup.SetupDataFragment;
|
import com.android.email.activity.setup.SetupDataFragment;
|
||||||
import com.android.emailcommon.provider.Account;
|
import com.android.emailcommon.provider.Account;
|
||||||
import com.android.emailcommon.provider.HostAuth;
|
import com.android.emailcommon.provider.HostAuth;
|
||||||
@ -46,7 +47,7 @@ public class AccountSetupIncomingTests extends
|
|||||||
private AccountSetupIncoming mActivity;
|
private AccountSetupIncoming mActivity;
|
||||||
private AccountSetupIncomingFragment mFragment;
|
private AccountSetupIncomingFragment mFragment;
|
||||||
private EditText mServerView;
|
private EditText mServerView;
|
||||||
private EditText mPasswordView;
|
private AuthenticationView mAuthenticationView;
|
||||||
|
|
||||||
public AccountSetupIncomingTests() {
|
public AccountSetupIncomingTests() {
|
||||||
super(AccountSetupIncoming.class);
|
super(AccountSetupIncoming.class);
|
||||||
@ -163,7 +164,7 @@ public class AccountSetupIncomingTests extends
|
|||||||
* @param expectNext true if expected that this password will enable the "next" button
|
* @param expectNext true if expected that this password will enable the "next" button
|
||||||
*/
|
*/
|
||||||
private void checkPassword(String password, boolean expectNext) throws URISyntaxException {
|
private void checkPassword(String password, boolean expectNext) throws URISyntaxException {
|
||||||
mPasswordView.setText(password);
|
mAuthenticationView.setPassword(password);
|
||||||
if (expectNext) {
|
if (expectNext) {
|
||||||
assertTrue(mActivity.mNextButtonEnabled);
|
assertTrue(mActivity.mNextButtonEnabled);
|
||||||
} else {
|
} else {
|
||||||
@ -183,7 +184,7 @@ public class AccountSetupIncomingTests extends
|
|||||||
mActivity = getActivity();
|
mActivity = getActivity();
|
||||||
mFragment = (AccountSetupIncomingFragment) mActivity.mFragment;
|
mFragment = (AccountSetupIncomingFragment) mActivity.mFragment;
|
||||||
mServerView = (EditText) mActivity.findViewById(R.id.account_server);
|
mServerView = (EditText) mActivity.findViewById(R.id.account_server);
|
||||||
mPasswordView = (EditText) mActivity.findViewById(R.id.account_password);
|
mAuthenticationView = (AuthenticationView) mActivity.findViewById(R.id.authentication_view);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user