diff options
author | Dmitri Plotnikov <dplotnikov@google.com> | 2010-09-22 17:04:42 -0700 |
---|---|---|
committer | Dmitri Plotnikov <dplotnikov@google.com> | 2010-09-22 17:04:42 -0700 |
commit | 3d67ff829e8acb0f650f155c3c0d377c0f46507a (patch) | |
tree | e350df8a397eb7a3aafe7bdb288dda05167b31f0 /tests | |
parent | 385182830ff0ed84edce9aba2424d2afe99453ce (diff) | |
download | packages_providers_ContactsProvider-3d67ff829e8acb0f650f155c3c0d377c0f46507a.zip packages_providers_ContactsProvider-3d67ff829e8acb0f650f155c3c0d377c0f46507a.tar.gz packages_providers_ContactsProvider-3d67ff829e8acb0f650f155c3c0d377c0f46507a.tar.bz2 |
Adding support for PHOTO_URI and PHOTO_THUMBNAIL_URI
Change-Id: I080c3227164eba6804095a4f0cbd82bb5093e161
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/android/providers/contacts/ContactsProvider2Test.java | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/src/com/android/providers/contacts/ContactsProvider2Test.java b/tests/src/com/android/providers/contacts/ContactsProvider2Test.java index 99ebd61..6dd9b5c 100644 --- a/tests/src/com/android/providers/contacts/ContactsProvider2Test.java +++ b/tests/src/com/android/providers/contacts/ContactsProvider2Test.java @@ -96,6 +96,8 @@ public class ContactsProvider2Test extends BaseContactsProvider2Test { Contacts.STARRED, Contacts.IN_VISIBLE_GROUP, Contacts.PHOTO_ID, + Contacts.PHOTO_URI, + Contacts.PHOTO_THUMBNAIL_URI, Contacts.CUSTOM_RINGTONE, Contacts.HAS_PHONE_NUMBER, Contacts.SEND_TO_VOICEMAIL, @@ -127,6 +129,8 @@ public class ContactsProvider2Test extends BaseContactsProvider2Test { Contacts.STARRED, Contacts.IN_VISIBLE_GROUP, Contacts.PHOTO_ID, + Contacts.PHOTO_URI, + Contacts.PHOTO_THUMBNAIL_URI, Contacts.CUSTOM_RINGTONE, Contacts.HAS_PHONE_NUMBER, Contacts.SEND_TO_VOICEMAIL, @@ -235,6 +239,8 @@ public class ContactsProvider2Test extends BaseContactsProvider2Test { Contacts.STARRED, Contacts.IN_VISIBLE_GROUP, Contacts.PHOTO_ID, + Contacts.PHOTO_URI, + Contacts.PHOTO_THUMBNAIL_URI, Contacts.CUSTOM_RINGTONE, Contacts.SEND_TO_VOICEMAIL, Contacts.LOOKUP_KEY, @@ -300,6 +306,8 @@ public class ContactsProvider2Test extends BaseContactsProvider2Test { Contacts.STARRED, Contacts.IN_VISIBLE_GROUP, Contacts.PHOTO_ID, + Contacts.PHOTO_URI, + Contacts.PHOTO_THUMBNAIL_URI, Contacts.HAS_PHONE_NUMBER, Contacts.CUSTOM_RINGTONE, Contacts.SEND_TO_VOICEMAIL, @@ -380,6 +388,8 @@ public class ContactsProvider2Test extends BaseContactsProvider2Test { Contacts.STARRED, Contacts.IN_VISIBLE_GROUP, Contacts.PHOTO_ID, + Contacts.PHOTO_URI, + Contacts.PHOTO_THUMBNAIL_URI, Contacts.CUSTOM_RINGTONE, Contacts.SEND_TO_VOICEMAIL, Contacts.LOOKUP_KEY, @@ -453,6 +463,8 @@ public class ContactsProvider2Test extends BaseContactsProvider2Test { PhoneLookup.STARRED, PhoneLookup.IN_VISIBLE_GROUP, PhoneLookup.PHOTO_ID, + PhoneLookup.PHOTO_URI, + PhoneLookup.PHOTO_THUMBNAIL_URI, PhoneLookup.CUSTOM_RINGTONE, PhoneLookup.HAS_PHONE_NUMBER, PhoneLookup.SEND_TO_VOICEMAIL, @@ -1336,7 +1348,6 @@ public class ContactsProvider2Test extends BaseContactsProvider2Test { insertStructuredName(rawContactId, "John", "Doe"); Uri photoUri = insertPhoto(rawContactId); long photoId = ContentUris.parseId(photoUri); - values.put(Contacts.PHOTO_ID, photoId); insertPhoneNumber(rawContactId, "18004664411"); insertPhoneNumber(rawContactId, "18004664412"); insertEmail(rawContactId, "goog411@acme.com"); @@ -2629,7 +2640,6 @@ public class ContactsProvider2Test extends BaseContactsProvider2Test { // The photo should be the remaining one assertStoredValue(Contacts.CONTENT_URI, contactId, Contacts.PHOTO_ID, ContentUris.parseId(photoUri1)); - } public void testContactDeletion() { @@ -2796,6 +2806,10 @@ public class ContactsProvider2Test extends BaseContactsProvider2Test { Uri twigUri = Uri.withAppendedPath(ContentUris.withAppendedId(Contacts.CONTENT_URI, queryContactId(rawContactId)), Contacts.Photo.CONTENT_DIRECTORY); + assertStoredValue( + ContentUris.withAppendedId(Contacts.CONTENT_URI, queryContactId(rawContactId)), + Contacts.PHOTO_URI, twigUri.toString()); + long twigId = Long.parseLong(getStoredValue(twigUri, Data._ID)); assertEquals(ContentUris.parseId(photoUri), twigId); } @@ -2839,6 +2853,8 @@ public class ContactsProvider2Test extends BaseContactsProvider2Test { Uri contactUri = ContentUris.withAppendedId(Contacts.CONTENT_URI, queryContactId(rawContactId1)); assertStoredValue(contactUri, Contacts.PHOTO_ID, photoId1); + assertStoredValue(contactUri, Contacts.PHOTO_URI, + Uri.withAppendedPath(contactUri, Contacts.Photo.CONTENT_DIRECTORY)); setAggregationException(AggregationExceptions.TYPE_KEEP_SEPARATE, rawContactId1, rawContactId2); |