diff options
author | Marcus Hagerott <mhagerott@google.com> | 2016-11-01 18:16:02 -0700 |
---|---|---|
committer | Marcus Hagerott <mhagerott@google.com> | 2016-11-02 10:26:45 -0700 |
commit | 7a756abd07f2074374cea81aa4e9a0ac8d52b6f1 (patch) | |
tree | 32259d3c40bb7ce9946ee1919e66f32b24462d88 /tests/src/com | |
parent | d0bedf51a1e2c16cd1585a9741310bc3e0b0f3f6 (diff) | |
download | Contacts-7a756abd07f2074374cea81aa4e9a0ac8d52b6f1.tar.gz |
Add experiment flag for device account detection.
Device account detection does DB queries that could potentially block the UI
thread. Just returning the "null" account as the only device account is fine
for now.
Test
* manually verify that "device" account still shows in editor and default
account chooser when no other accounts exist
* manually verify that "device" account still shows in nav drawer when another
non-google account is added
* manually verify that "device" account is hidden after Google Account is
added
Bug 32312206
Change-Id: I347e9dcf0aa6252c7b0be79fea7757b03569edf7
Diffstat (limited to 'tests/src/com')
-rw-r--r-- | tests/src/com/android/contacts/common/model/Cp2DeviceLocalAccountLocatorTests.java (renamed from tests/src/com/android/contacts/common/model/DeviceLocalAccountLocatorTests.java) | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/src/com/android/contacts/common/model/DeviceLocalAccountLocatorTests.java b/tests/src/com/android/contacts/common/model/Cp2DeviceLocalAccountLocatorTests.java index e8c4e2f75..192eb447f 100644 --- a/tests/src/com/android/contacts/common/model/DeviceLocalAccountLocatorTests.java +++ b/tests/src/com/android/contacts/common/model/Cp2DeviceLocalAccountLocatorTests.java @@ -40,12 +40,12 @@ import java.util.List; import java.util.Map; @SmallTest -public class DeviceLocalAccountLocatorTests extends AndroidTestCase { +public class Cp2DeviceLocalAccountLocatorTests extends AndroidTestCase { // Basic smoke test that just checks that it doesn't throw when loading from CP2. We don't // care what CP2 actually contains for this. public void testShouldNotCrash() { - final DeviceLocalAccountLocator sut = new DeviceLocalAccountLocator( + final DeviceLocalAccountLocator sut = new Cp2DeviceLocalAccountLocator( getContext().getContentResolver(), new DeviceLocalAccountTypeFactory.Default(getContext()), Collections.<AccountWithDataSet>emptyList()); @@ -80,7 +80,7 @@ public class DeviceLocalAccountLocatorTests extends AndroidTestCase { final DeviceLocalAccountTypeFactory stubFactory = new FakeDeviceAccountTypeFactory() .withDeviceTypes(null, "vnd.sec.contact.phone") .withSimTypes("vnd.sec.contact.sim"); - final DeviceLocalAccountLocator sut = new DeviceLocalAccountLocator( + final DeviceLocalAccountLocator sut = new Cp2DeviceLocalAccountLocator( createStubResolverWithContentQueryResult(queryResult( "user", "com.example", "user", "com.example", @@ -98,7 +98,7 @@ public class DeviceLocalAccountLocatorTests extends AndroidTestCase { } public void test_getDeviceLocalAccounts_doesNotContainItemsForKnownAccounts() { - final DeviceLocalAccountLocator sut = new DeviceLocalAccountLocator( + final Cp2DeviceLocalAccountLocator sut = new Cp2DeviceLocalAccountLocator( getContext().getContentResolver(), new FakeDeviceAccountTypeFactory(), Arrays.asList(new AccountWithDataSet("user", "com.example", null), new AccountWithDataSet("user1", "com.example", null), @@ -116,7 +116,7 @@ public class DeviceLocalAccountLocatorTests extends AndroidTestCase { final DeviceLocalAccountTypeFactory stubFactory = new FakeDeviceAccountTypeFactory() .withDeviceTypes(null, "vnd.sec.contact.phone") .withSimTypes("vnd.sec.contact.sim"); - final DeviceLocalAccountLocator sut = new DeviceLocalAccountLocator( + final DeviceLocalAccountLocator sut = new Cp2DeviceLocalAccountLocator( createContentResolverWithProvider(new FakeContactsProvider() .withQueryResult(ContactsContract.Settings.CONTENT_URI, queryResult( "phone_account", "vnd.sec.contact.phone", @@ -130,7 +130,7 @@ public class DeviceLocalAccountLocatorTests extends AndroidTestCase { final DeviceLocalAccountTypeFactory stubFactory = new FakeDeviceAccountTypeFactory() .withDeviceTypes(null, "vnd.sec.contact.phone") .withSimTypes("vnd.sec.contact.sim"); - final DeviceLocalAccountLocator sut = new DeviceLocalAccountLocator( + final DeviceLocalAccountLocator sut = new Cp2DeviceLocalAccountLocator( createContentResolverWithProvider(new FakeContactsProvider() .withQueryResult(ContactsContract.Groups.CONTENT_URI, queryResult( "phone_account", "vnd.sec.contact.phone", @@ -142,7 +142,7 @@ public class DeviceLocalAccountLocatorTests extends AndroidTestCase { private DeviceLocalAccountLocator createWithQueryResult( Cursor cursor) { - final DeviceLocalAccountLocator locator = new DeviceLocalAccountLocator( + final DeviceLocalAccountLocator locator = new Cp2DeviceLocalAccountLocator( createStubResolverWithContentQueryResult(cursor), new DeviceLocalAccountTypeFactory.Default(getContext()), Collections.<AccountWithDataSet>emptyList()); |