Fix some broken tests

b/13085182
You can't look up emailServiceInfo for smtp, we don't store that
in services.xml. The thing is, if we're using outgoing settings,
we're always using smtp, which allows oauth.

Change-Id: I5c6032e8d5020ba83fa1c803666b83f134f87f75
This commit is contained in:
Martin Hibdon 2014-02-19 16:15:43 -08:00
parent 56b7ef3c0d
commit 10c7412555
2 changed files with 5 additions and 10 deletions

View File

@ -75,7 +75,6 @@ public class AccountSetupOutgoingFragment extends AccountServerBaseFragment
private EditText mPortView;
private CheckBox mRequireLoginView;
private Spinner mSecurityTypeView;
private EmailServiceInfo mServiceInfo;
// Support for lifecycle
private boolean mStarted;
@ -283,7 +282,6 @@ public class AccountSetupOutgoingFragment extends AccountServerBaseFragment
if (mLoaded) return;
final HostAuth sendAuth = mSetupData.getAccount().getOrCreateHostAuthSend(mContext);
mServiceInfo = EmailServiceUtils.getServiceInfo(mContext, sendAuth.mProtocol);
if ((sendAuth.mFlags & HostAuth.FLAG_AUTHENTICATE) != 0) {
final String username = sendAuth.mLogin;
if (username != null) {
@ -293,11 +291,7 @@ public class AccountSetupOutgoingFragment extends AccountServerBaseFragment
mAuthenticationView.setAuthInfo(true, sendAuth);
if (mAuthenticationLabel != null) {
if (mServiceInfo.offerOAuth) {
mAuthenticationLabel.setText(R.string.authentication_label);
} else {
mAuthenticationLabel.setText(R.string.password_label);
}
mAuthenticationLabel.setText(R.string.authentication_label);
}
}

View File

@ -26,6 +26,7 @@ import android.widget.EditText;
import com.android.email.R;
import com.android.email.activity.setup.AccountSetupOutgoing;
import com.android.email.activity.setup.AccountSetupOutgoingFragment;
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;
@ -44,7 +45,7 @@ public class AccountSetupOutgoingTests extends
private AccountSetupOutgoing mActivity;
private AccountSetupOutgoingFragment mFragment;
private EditText mServerView;
private EditText mPasswordView;
private AuthenticationView mAuthenticationView;
public AccountSetupOutgoingTests() {
super(AccountSetupOutgoing.class);
@ -159,7 +160,7 @@ public class AccountSetupOutgoingTests 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 {
@ -178,7 +179,7 @@ public class AccountSetupOutgoingTests extends
mActivity = getActivity();
mFragment = mActivity.mFragment;
mServerView = (EditText) mActivity.findViewById(R.id.account_server);
mPasswordView = (EditText) mActivity.findViewById(R.id.account_server);
mAuthenticationView = (AuthenticationView) mActivity.findViewById(R.id.account_server);
}
/**