diff options
author | Dmitri Plotnikov <dplotnikov@google.com> | 2010-11-30 10:42:38 -0800 |
---|---|---|
committer | Dmitri Plotnikov <dplotnikov@google.com> | 2010-11-30 10:42:38 -0800 |
commit | 244f914757fef93841d33a300a1b42a77ac80b2e (patch) | |
tree | 8f7642d86a6f65feab9eb53472342d68c81e4fd3 /tests | |
parent | 89b7c2b6e0003b17d08002f02d6aeec9f9788c8d (diff) | |
download | packages_providers_ContactsProvider-244f914757fef93841d33a300a1b42a77ac80b2e.zip packages_providers_ContactsProvider-244f914757fef93841d33a300a1b42a77ac80b2e.tar.gz packages_providers_ContactsProvider-244f914757fef93841d33a300a1b42a77ac80b2e.tar.bz2 |
Fixing GlobalSearchSupportTest
Bug: 3240329
Change-Id: I8063812cf567fb4f290b5a488fcdc2ef20b38ed2
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/android/providers/contacts/GlobalSearchSupportTest.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/src/com/android/providers/contacts/GlobalSearchSupportTest.java b/tests/src/com/android/providers/contacts/GlobalSearchSupportTest.java index fe15306..29ebb7f 100644 --- a/tests/src/com/android/providers/contacts/GlobalSearchSupportTest.java +++ b/tests/src/com/android/providers/contacts/GlobalSearchSupportTest.java @@ -23,6 +23,8 @@ import android.database.Cursor; import android.database.DatabaseUtils; import android.net.Uri; import android.provider.ContactsContract; +import android.provider.ContactsContract.CommonDataKinds.GroupMembership; +import android.provider.ContactsContract.Data; import android.provider.ContactsContract.Intents; import android.provider.ContactsContract.StatusUpdates; import android.test.suitebuilder.annotation.LargeTest; @@ -40,11 +42,19 @@ import android.test.suitebuilder.annotation.LargeTest; @LargeTest public class GlobalSearchSupportTest extends BaseContactsProvider2Test { - public void testSearchSuggestionsNotInVisibleGroup() throws Exception { + public void testSearchSuggestionsNotInDefaultDirectory() throws Exception { Account account = new Account("actname", "acttype"); + + // Creating an AUTO_ADD group will exclude all ungrouped contacts from global search + createGroup(account, "any", "any", 0 /* visible */, true /* auto-add */, false /* fav */); + long rawContactId = createRawContact(account); insertStructuredName(rawContactId, "Deer", "Dough"); + // Remove the new contact from all groups + mResolver.delete(Data.CONTENT_URI, Data.RAW_CONTACT_ID + "=" + rawContactId + + " AND " + Data.MIMETYPE + "='" + GroupMembership.CONTENT_ITEM_TYPE + "'", null); + Uri searchUri = new Uri.Builder().scheme("content").authority(ContactsContract.AUTHORITY) .appendPath(SearchManager.SUGGEST_URI_PATH_QUERY).appendPath("D").build(); |