diff options
author | Dave Santoro <dsantoro@google.com> | 2011-08-01 14:07:51 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-08-01 14:07:51 -0700 |
commit | dd13a37943dbe4cd2c0a055a1e79811d818b8da7 (patch) | |
tree | 9a6cd57e222bfd244ff50491fc79535277bdf096 /tests | |
parent | 3606209fe0f5bac0e7d312f0c1576b7ee5cf8ee7 (diff) | |
parent | a09d7527b132ec82f98cde1564b0262fd85768c2 (diff) | |
download | packages_providers_ContactsProvider-dd13a37943dbe4cd2c0a055a1e79811d818b8da7.zip packages_providers_ContactsProvider-dd13a37943dbe4cd2c0a055a1e79811d818b8da7.tar.gz packages_providers_ContactsProvider-dd13a37943dbe4cd2c0a055a1e79811d818b8da7.tar.bz2 |
Merge "Create account record if needed on profile insert."
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/android/providers/contacts/ContactsProvider2Test.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/src/com/android/providers/contacts/ContactsProvider2Test.java b/tests/src/com/android/providers/contacts/ContactsProvider2Test.java index 1cc3b1e..875479b 100644 --- a/tests/src/com/android/providers/contacts/ContactsProvider2Test.java +++ b/tests/src/com/android/providers/contacts/ContactsProvider2Test.java @@ -1945,6 +1945,23 @@ public class ContactsProvider2Test extends BaseContactsProvider2Test { getExpectedProfileDataValues()); } + public void testInsertProfileWithDataSetTriggersAccountCreation() { + // Check that we have no profile raw contacts. + assertStoredValues(Profile.CONTENT_RAW_CONTACTS_URI, new ContentValues[]{}); + + // Insert a profile record with a new data set. + Account account = new Account("a", "b"); + String dataSet = "c"; + Uri profileUri = maybeAddAccountQueryParameters(Profile.CONTENT_RAW_CONTACTS_URI, account) + .buildUpon().appendQueryParameter(RawContacts.DATA_SET, dataSet).build(); + ContentValues values = new ContentValues(); + long rawContactId = ContentUris.parseId(mResolver.insert(profileUri, values)); + values.put(RawContacts._ID, rawContactId); + + // Check that querying for the profile gets the created raw contact. + assertStoredValues(Profile.CONTENT_RAW_CONTACTS_URI, values); + } + public void testPhonesWithStatusUpdate() { ContentValues values = new ContentValues(); |