diff --git a/tests/src/com/android/email/activity/setup/AccountSetupOutgoingTests.java b/tests/src/com/android/email/activity/setup/AccountSetupOutgoingTests.java index 1dc78e8f5..5bae429cf 100644 --- a/tests/src/com/android/email/activity/setup/AccountSetupOutgoingTests.java +++ b/tests/src/com/android/email/activity/setup/AccountSetupOutgoingTests.java @@ -21,6 +21,7 @@ import android.content.Intent; import android.test.ActivityInstrumentationTestCase2; import android.test.UiThreadTest; import android.test.suitebuilder.annotation.MediumTest; +import android.widget.CheckBox; import android.widget.EditText; import com.android.email.R; @@ -68,6 +69,7 @@ public class AccountSetupOutgoingTests extends /** * Test processing with a complete, good URI -> good fields */ + @UiThreadTest public void testGoodUri() { getActivityAndFields(); assertTrue(isNextButtonEnabled()); @@ -77,10 +79,18 @@ public class AccountSetupOutgoingTests extends * No user is not OK - not enabled */ public void testBadUriNoUser() - throws URISyntaxException { + throws Throwable { Intent i = getTestIntent("smtp://:password@server.com:999"); setActivityIntent(i); getActivityAndFields(); + runTestOnUiThread(new Runnable() { + @Override + public void run() { + final CheckBox requireLoginView = (CheckBox) + mActivity.findViewById(R.id.account_require_login); + requireLoginView.setChecked(true); + } + }); assertFalse(isNextButtonEnabled()); } diff --git a/tests/src/com/android/emailcommon/provider/HostAuthTests.java b/tests/src/com/android/emailcommon/provider/HostAuthTests.java index 2cef32623..c319fcb93 100644 --- a/tests/src/com/android/emailcommon/provider/HostAuthTests.java +++ b/tests/src/com/android/emailcommon/provider/HostAuthTests.java @@ -80,9 +80,9 @@ public class HostAuthTests extends AndroidTestCase { ha.setLogin("user", ""); assertEquals(HostAuth.FLAG_AUTHENTICATE, ha.mFlags); - ha.mFlags = 0x00000000; + ha.mFlags = 0xffffffff; ha.setLogin("", "password"); - assertEquals(HostAuth.FLAG_AUTHENTICATE, ha.mFlags); + assertEquals(~HostAuth.FLAG_AUTHENTICATE, ha.mFlags); ha.mFlags = 0x00000000; ha.setLogin("user", null);