Search in sources :

Example 1 with ContactsManager

use of com.android.inputmethod.latin.ContactsManager in project android_packages_inputmethods_LatinIME by CyanogenMod.

the class ContactsManagerTest method setUp.

@Before
@Override
public void setUp() throws Exception {
    // Fake content provider
    mFakeContactsContentProvider = new FakeContactsContentProvider();
    mMatrixCursor = new MatrixCursor(ContactsDictionaryConstants.PROJECTION);
    // Add the fake content provider to fake content resolver.
    final MockContentResolver contentResolver = new MockContentResolver();
    contentResolver.addProvider(ContactsContract.AUTHORITY, mFakeContactsContentProvider);
    // Add the fake content resolver to a fake context.
    final ContextWithMockContentResolver context = new ContextWithMockContentResolver(mContext);
    context.setContentResolver(contentResolver);
    mManager = new ContactsManager(context);
}
Also used : ContactsManager(com.android.inputmethod.latin.ContactsManager) MockContentResolver(android.test.mock.MockContentResolver) MatrixCursor(android.database.MatrixCursor) Before(org.junit.Before)

Aggregations

MatrixCursor (android.database.MatrixCursor)1 MockContentResolver (android.test.mock.MockContentResolver)1 ContactsManager (com.android.inputmethod.latin.ContactsManager)1 Before (org.junit.Before)1