summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDave Santoro <dsantoro@google.com>2011-08-01 14:07:51 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-08-01 14:07:51 -0700
commitdd13a37943dbe4cd2c0a055a1e79811d818b8da7 (patch)
tree9a6cd57e222bfd244ff50491fc79535277bdf096 /tests
parent3606209fe0f5bac0e7d312f0c1576b7ee5cf8ee7 (diff)
parenta09d7527b132ec82f98cde1564b0262fd85768c2 (diff)
downloadpackages_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.java17
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();