diff options
author | Mathew Inwood <mathewi@google.com> | 2012-07-04 09:26:07 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-07-04 09:26:07 -0700 |
commit | 5a2cfba2623b8606ec5eb1a8e443957da2495e84 (patch) | |
tree | e873c91dd016bf8a3fc3826822a84587b0af758f /tests/src | |
parent | 7691772c14f7f2f632b04b8149e4b96d5cae3b67 (diff) | |
parent | 084a9d5ee564c758ff7709690ab404d6ac58e78d (diff) | |
download | packages_providers_ContactsProvider-5a2cfba2623b8606ec5eb1a8e443957da2495e84.zip packages_providers_ContactsProvider-5a2cfba2623b8606ec5eb1a8e443957da2495e84.tar.gz packages_providers_ContactsProvider-5a2cfba2623b8606ec5eb1a8e443957da2495e84.tar.bz2 |
am 084a9d5e: Don\'t sort contacts supplied to global search app.
* commit '084a9d5ee564c758ff7709690ab404d6ac58e78d':
Don't sort contacts supplied to global search app.
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/com/android/providers/contacts/GlobalSearchSupportTest.java | 56 |
1 files changed, 2 insertions, 54 deletions
diff --git a/tests/src/com/android/providers/contacts/GlobalSearchSupportTest.java b/tests/src/com/android/providers/contacts/GlobalSearchSupportTest.java index 3c95c11..c776109 100644 --- a/tests/src/com/android/providers/contacts/GlobalSearchSupportTest.java +++ b/tests/src/com/android/providers/contacts/GlobalSearchSupportTest.java @@ -113,8 +113,7 @@ public class GlobalSearchSupportTest extends BaseContactsProvider2Test { GoldenContact contact = new GoldenContactBuilder().name("Deer", "Dough").photo( loadTestPhoto()).phone("1-800-4664-411").build(); new SuggestionTesterBuilder(contact).query("1800").expectIcon1Uri(true).expectedText1( - "Deer Dough").expectedText2("1-800-4664-411").expectedCreateContactNumber("1800") - .build().test(); + "Deer Dough").expectedText2("1-800-4664-411").build().test(); } public void assertCreateContactSuggestion(Cursor c, String number) { @@ -131,42 +130,6 @@ public class GlobalSearchSupportTest extends BaseContactsProvider2Test { assertCursorValues(c, values); } - public void searchSuggestionsByPhoneNumberOnPhoneTest(String number) { - getContactsProvider().setIsPhone(true); - getContactsProvider().setIsVoiceCapable(true); - - ContentValues values = new ContentValues(); - - Uri searchUri = new Uri.Builder().scheme("content").authority(ContactsContract.AUTHORITY) - .appendPath(SearchManager.SUGGEST_URI_PATH_QUERY).appendPath(number).build(); - - Cursor c = mResolver.query(searchUri, null, null, null, null); - assertEquals(2, c.getCount()); - c.moveToFirst(); - values.put(SearchManager.SUGGEST_COLUMN_TEXT_1, "Dial number"); - values.put(SearchManager.SUGGEST_COLUMN_TEXT_2, "using " + number); - values.put(SearchManager.SUGGEST_COLUMN_ICON_1, - String.valueOf(com.android.internal.R.drawable.call_contact)); - values.put(SearchManager.SUGGEST_COLUMN_INTENT_ACTION, - Intents.SEARCH_SUGGESTION_DIAL_NUMBER_CLICKED); - values.put(SearchManager.SUGGEST_COLUMN_INTENT_DATA, "tel:" + number); - values.put(SearchManager.SUGGEST_COLUMN_SHORTCUT_ID, - SearchManager.SUGGEST_NEVER_MAKE_SHORTCUT); - assertCursorValues(c, values); - - c.moveToNext(); - assertCreateContactSuggestion(c, number); - c.close(); - } - - public void testSearchSuggestionsByPhoneNumberOnPhone() throws Exception { - searchSuggestionsByPhoneNumberOnPhoneTest("12345678"); - } - - public void testSearchSuggestionsByAlphnumericPhoneNumberOnPhone() throws Exception { - searchSuggestionsByPhoneNumberOnPhoneTest("1800-flowers"); - } - /** * Tests that the quick search suggestion returns the expected contact * information. @@ -185,8 +148,6 @@ public class GlobalSearchSupportTest extends BaseContactsProvider2Test { private final String expectedText2; - private final String expectedCreateContactNumber; - public SuggestionTester(SuggestionTesterBuilder builder) { contact = builder.contact; query = builder.query; @@ -194,7 +155,6 @@ public class GlobalSearchSupportTest extends BaseContactsProvider2Test { expectedIcon2 = builder.expectedIcon2; expectedText1 = builder.expectedText1; expectedText2 = builder.expectedText2; - expectedCreateContactNumber = builder.expectedCreateContactNumber; } /** @@ -222,7 +182,7 @@ public class GlobalSearchSupportTest extends BaseContactsProvider2Test { .appendPath(query).build(); Cursor c = mResolver.query(searchUri, null, null, null, null); - assertEquals(expectedCreateContactNumber == null ? 1 : 2, c.getCount()); + assertEquals(1, c.getCount()); c.moveToFirst(); String icon1 = c.getString(c.getColumnIndex(SearchManager.SUGGEST_COLUMN_ICON_1)); @@ -237,11 +197,6 @@ public class GlobalSearchSupportTest extends BaseContactsProvider2Test { ContentValues values = getContactValues(); assertCursorValues(c, values); - if (expectedCreateContactNumber != null) { - c.moveToNext(); - assertCreateContactSuggestion(c, expectedCreateContactNumber); - } - c.close(); } @@ -360,8 +315,6 @@ public class GlobalSearchSupportTest extends BaseContactsProvider2Test { private String expectedText2; - private String expectedCreateContactNumber; - public SuggestionTesterBuilder(GoldenContact contact) { this.contact = contact; } @@ -418,10 +371,5 @@ public class GlobalSearchSupportTest extends BaseContactsProvider2Test { expectedText2 = value; return this; } - - public SuggestionTesterBuilder expectedCreateContactNumber(String number) { - expectedCreateContactNumber = number; - return this; - } } } |