diff options
author | Dmitri Plotnikov <dplotnikov@google.com> | 2010-10-14 15:40:42 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-10-14 15:40:42 -0700 |
commit | 117166d023b9d9405f18cc5222b18fd16a13660c (patch) | |
tree | 7112bd1d8deb70031d809ddbef3f9c1b9d523d34 /tests | |
parent | afcfc0005f7c93d46c28cdd8e18f956287ca0d18 (diff) | |
parent | 093b6446d0c63b8d725324ea41369b76ace153df (diff) | |
download | packages_providers_ContactsProvider-117166d023b9d9405f18cc5222b18fd16a13660c.zip packages_providers_ContactsProvider-117166d023b9d9405f18cc5222b18fd16a13660c.tar.gz packages_providers_ContactsProvider-117166d023b9d9405f18cc5222b18fd16a13660c.tar.bz2 |
Merge "Fixing the trigger for aggregated presence." into gingerbread
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/android/providers/contacts/ContactsProvider2Test.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/src/com/android/providers/contacts/ContactsProvider2Test.java b/tests/src/com/android/providers/contacts/ContactsProvider2Test.java index 5114894..5b40485 100644 --- a/tests/src/com/android/providers/contacts/ContactsProvider2Test.java +++ b/tests/src/com/android/providers/contacts/ContactsProvider2Test.java @@ -1345,6 +1345,34 @@ public class ContactsProvider2Test extends BaseContactsProvider2Test { assertStoredValuesWithProjection(contactUri, values); } + public void testStatusUpdateUpdateToNull() { + long rawContactId = createRawContact(); + insertImHandle(rawContactId, Im.PROTOCOL_AIM, null, "aim"); + + long contactId = queryContactId(rawContactId); + Uri contactUri = ContentUris.withAppendedId(Contacts.CONTENT_URI, contactId); + + ContentValues values = new ContentValues(); + Uri statusUri = + insertStatusUpdate(Im.PROTOCOL_AIM, null, "aim", StatusUpdates.AVAILABLE, "Available", + StatusUpdates.CAPABILITY_HAS_CAMERA); + long statusId = ContentUris.parseId(statusUri); + + values.put(Contacts.CONTACT_PRESENCE, StatusUpdates.AVAILABLE); + values.put(Contacts.CONTACT_STATUS, "Available"); + assertStoredValuesWithProjection(contactUri, values); + + values.clear(); + values.putNull(StatusUpdates.PRESENCE); + mResolver.update(StatusUpdates.CONTENT_URI, values, + StatusUpdates.DATA_ID + "=" + statusId, null); + + values.clear(); + values.putNull(Contacts.CONTACT_PRESENCE); + values.put(Contacts.CONTACT_STATUS, "Available"); + assertStoredValuesWithProjection(contactUri, values); + } + public void testStatusUpdateWithTimestamp() { long rawContactId = createRawContact(); insertImHandle(rawContactId, Im.PROTOCOL_AIM, null, "aim"); |