summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarcus Hagerott <mhagerott@google.com>2016-12-15 15:52:22 -0800
committerMarcus Hagerott <mhagerott@google.com>2016-12-19 17:31:20 -0800
commit4bd50d69d2b8934dbd4cbd634ad83807d9b02735 (patch)
treecd7d2b6d0c641e43325b59e4f9bf9aa296d33e43 /tests
parent96e7fc65257e1aab2f1fc4f7900832514f584b0f (diff)
downloadpackages_apps_Contacts-4bd50d69d2b8934dbd4cbd634ad83807d9b02735.tar.gz
packages_apps_Contacts-4bd50d69d2b8934dbd4cbd634ad83807d9b02735.tar.bz2
packages_apps_Contacts-4bd50d69d2b8934dbd4cbd634ad83807d9b02735.zip
Use loader for accounts in editor fragment
Test: manually remove selected account in editor and verify that it changes to the first account in list Bug: 33627801 Change-Id: I6554f03c207fb761f7b8d971e0f07f7416efcd72
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/contacts/editor/EditorUiUtilsTest.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/src/com/android/contacts/editor/EditorUiUtilsTest.java b/tests/src/com/android/contacts/editor/EditorUiUtilsTest.java
index b42308d17..9eea4d1e1 100644
--- a/tests/src/com/android/contacts/editor/EditorUiUtilsTest.java
+++ b/tests/src/com/android/contacts/editor/EditorUiUtilsTest.java
@@ -26,8 +26,11 @@ import android.test.suitebuilder.annotation.SmallTest;
import com.android.contacts.R;
import com.android.contacts.model.account.AccountDisplayInfo;
+import com.android.contacts.model.account.AccountInfo;
import com.android.contacts.model.account.AccountType;
import com.android.contacts.model.account.AccountWithDataSet;
+import com.android.contacts.model.account.DeviceLocalAccountType;
+import com.android.contacts.tests.FakeAccountType;
/**
* Tests {@link EditorUiUtils}.
@@ -73,8 +76,9 @@ public class EditorUiUtilsTest extends AndroidTestCase {
}
public void testGetProfileAccountInfo_NonLocalAccount() {
- final AccountDisplayInfo account = new AccountDisplayInfo(ACCOUNT, ACCOUNT_NAME,
- DISPLAY_LABEL, /*icon*/ null, /*isDeviceAccount*/ false);
+ final AccountInfo account = new AccountInfo(new AccountDisplayInfo(ACCOUNT, ACCOUNT_NAME,
+ DISPLAY_LABEL, null, /* isDeviceAccount */ false),
+ new FakeAccountType("com.example.account"));
final String label = EditorUiUtils.getAccountHeaderLabelForMyProfile(getContext(),
account);
@@ -87,8 +91,8 @@ public class EditorUiUtilsTest extends AndroidTestCase {
public void testGetProfileAccountInfo_DeviceLocalAccount() {
- final AccountDisplayInfo account = new AccountDisplayInfo(ACCOUNT, "Device",
- "Device", null, true);
+ final AccountInfo account = new AccountInfo(new AccountDisplayInfo(ACCOUNT, "Device",
+ "Device", null, true), new DeviceLocalAccountType(mContext));
final String label = EditorUiUtils.getAccountHeaderLabelForMyProfile(getContext(),
account);