Fix account setup test

Change-Id: I7c1b785e5aa29cc7f47920d857441f1a09f05b21
This commit is contained in:
Martin Hibdon 2014-02-18 12:25:09 -08:00
parent 0962a44fc4
commit ad94ecc471
2 changed files with 8 additions and 7 deletions

View File

@ -25,10 +25,6 @@ import com.android.emailcommon.provider.HostAuth;
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 {
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() {
return getPasswordEditText().getText().toString();
}

View File

@ -27,6 +27,7 @@ import android.widget.EditText;
import com.android.email.R;
import com.android.email.activity.setup.AccountSetupIncoming;
import com.android.email.activity.setup.AccountSetupIncomingFragment;
import com.android.email.activity.setup.AuthenticationView;
import com.android.email.activity.setup.SetupDataFragment;
import com.android.emailcommon.provider.Account;
import com.android.emailcommon.provider.HostAuth;
@ -46,7 +47,7 @@ public class AccountSetupIncomingTests extends
private AccountSetupIncoming mActivity;
private AccountSetupIncomingFragment mFragment;
private EditText mServerView;
private EditText mPasswordView;
private AuthenticationView mAuthenticationView;
public AccountSetupIncomingTests() {
super(AccountSetupIncoming.class);
@ -163,7 +164,7 @@ public class AccountSetupIncomingTests extends
* @param expectNext true if expected that this password will enable the "next" button
*/
private void checkPassword(String password, boolean expectNext) throws URISyntaxException {
mPasswordView.setText(password);
mAuthenticationView.setPassword(password);
if (expectNext) {
assertTrue(mActivity.mNextButtonEnabled);
} else {
@ -183,7 +184,7 @@ public class AccountSetupIncomingTests extends
mActivity = getActivity();
mFragment = (AccountSetupIncomingFragment) mActivity.mFragment;
mServerView = (EditText) mActivity.findViewById(R.id.account_server);
mPasswordView = (EditText) mActivity.findViewById(R.id.account_password);
mAuthenticationView = (AuthenticationView) mActivity.findViewById(R.id.authentication_view);
}
/**