diff options
author | Dmitri Plotnikov <dplotnikov@google.com> | 2010-11-30 12:00:59 -0800 |
---|---|---|
committer | Dmitri Plotnikov <dplotnikov@google.com> | 2010-11-30 12:00:59 -0800 |
commit | 89ea0fad8212b989e0f64e8b07da2bf642b45d83 (patch) | |
tree | 32f8c2073773b46bf6d202b79a739e3664ea0bd0 /tests | |
parent | 244f914757fef93841d33a300a1b42a77ac80b2e (diff) | |
download | packages_providers_ContactsProvider-89ea0fad8212b989e0f64e8b07da2bf642b45d83.zip packages_providers_ContactsProvider-89ea0fad8212b989e0f64e8b07da2bf642b45d83.tar.gz packages_providers_ContactsProvider-89ea0fad8212b989e0f64e8b07da2bf642b45d83.tar.bz2 |
Fixing DirectoryTest
Bug: 3240412
Change-Id: I25d915b179be19e769b9f577fe21a1d9d0681206
Diffstat (limited to 'tests')
3 files changed, 10 insertions, 2 deletions
diff --git a/tests/src/com/android/providers/contacts/BaseContactsProvider2Test.java b/tests/src/com/android/providers/contacts/BaseContactsProvider2Test.java index 717c2ed..d1b013a 100644 --- a/tests/src/com/android/providers/contacts/BaseContactsProvider2Test.java +++ b/tests/src/com/android/providers/contacts/BaseContactsProvider2Test.java @@ -98,8 +98,7 @@ public abstract class BaseContactsProvider2Test extends AndroidTestCase { mActor = new ContactsActor(getContext(), PACKAGE_GREY, getProviderClass(), getAuthority()); mResolver = mActor.resolver; if (mActor.provider instanceof SynchronousContactsProvider2) { - ((SynchronousContactsProvider2) mActor.provider) - .getDatabaseHelper(mActor.context).wipeData(); + ((SynchronousContactsProvider2) mActor.provider).wipeData(); } } diff --git a/tests/src/com/android/providers/contacts/LegacyContactImporterPerformanceTest.java b/tests/src/com/android/providers/contacts/LegacyContactImporterPerformanceTest.java index 50ba389..a5a095c 100644 --- a/tests/src/com/android/providers/contacts/LegacyContactImporterPerformanceTest.java +++ b/tests/src/com/android/providers/contacts/LegacyContactImporterPerformanceTest.java @@ -19,6 +19,7 @@ package com.android.providers.contacts; import android.content.ContentProvider; import android.content.Context; import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; import android.content.res.Resources; import android.os.Debug; import android.provider.CallLog; @@ -80,7 +81,13 @@ public class LegacyContactImporterPerformanceTest extends AndroidTestCase { ai.packageName = "contactsTestPackage"; return ai; } + + @Override + public PackageManager getPackageManager() { + return new ContactsMockPackageManager(); + } }; + RenamingDelegatingContext targetContextWrapper = new RenamingDelegatingContext(context, targetContext, "perf_imp."); targetContextWrapper.makeExistingFilesAndDbsAccessible(); diff --git a/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.java b/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.java index 3c3e1b5..5fe3c48 100644 --- a/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.java +++ b/tests/src/com/android/providers/contacts/SynchronousContactsProvider2.java @@ -168,6 +168,8 @@ public class SynchronousContactsProvider2 extends ContactsProvider2 { db.execSQL("replace into SQLITE_SEQUENCE (name,seq) values('raw_contacts', 42)"); db.execSQL("replace into SQLITE_SEQUENCE (name,seq) values('contacts', 2009)"); db.execSQL("replace into SQLITE_SEQUENCE (name,seq) values('data', 777)"); + + getContactDirectoryManager().scanAllPackages(); } @Override |