Merge "Fix AccountSetupExchangeTests.testLoadFields()"

This commit is contained in:
Makoto Onuki 2010-03-09 13:37:19 -08:00 committed by Android (Google) Code Review
commit 62c76bcb23
2 changed files with 11 additions and 3 deletions

View File

@ -142,8 +142,8 @@ public class AccountSetupExchangeTests extends
// "trust certificates" checkbox (not checked, but visible now).
Account account =
ProviderTestUtils.setupAccount("account", false, mActivity.getBaseContext());
account.mHostAuthRecv =
ProviderTestUtils.setupHostAuth("hostauth", 1, false, mActivity.getBaseContext());
account.mHostAuthRecv = ProviderTestUtils.setupHostAuth(
"eas", "hostauth", 1, false, mActivity.getBaseContext());
account.mHostAuthRecv.mFlags |= HostAuth.FLAG_SSL;
account.mHostAuthRecv.mFlags &= ~HostAuth.FLAG_TRUST_ALL_CERTIFICATES;
mActivity.loadFields(account);

View File

@ -68,9 +68,17 @@ public class ProviderTestUtils extends Assert {
*/
public static HostAuth setupHostAuth(String name, long accountId, boolean saveIt,
Context context) {
return setupHostAuth("protocol", name, accountId, saveIt, context);
}
/**
* Create a hostauth record for test purposes
*/
public static HostAuth setupHostAuth(String protocol, String name, long accountId,
boolean saveIt, Context context) {
HostAuth hostAuth = new HostAuth();
hostAuth.mProtocol = "protocol-" + name;
hostAuth.mProtocol = protocol + "-" + name;
hostAuth.mAddress = "address-" + name;
hostAuth.mPort = 100;
hostAuth.mFlags = 200;