Fix CalendarSyncAdapterTests
Bug: 3077174 Change-Id: Ic0ba851969e852488a72241c8fba9f466c5bc3a6
This commit is contained in:
parent
30c99e0dc3
commit
fde172f576
@ -51,7 +51,7 @@ public class SyncAdapterTestCase<T extends AbstractSyncAdapter>
|
||||
super.setUp();
|
||||
mMockContext = getMockContext();
|
||||
mMockResolver = (MockContentResolver)mMockContext.getContentResolver();
|
||||
mMockResolver.addProvider(MockProvider.AUTHORITY, new MockProvider());
|
||||
mMockResolver.addProvider(MockProvider.AUTHORITY, new MockProvider(mMockContext));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ package com.android.exchange.provider;
|
||||
|
||||
import android.content.ContentProvider;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.content.UriMatcher;
|
||||
import android.database.Cursor;
|
||||
import android.database.MatrixCursor;
|
||||
@ -69,6 +70,10 @@ public class MockProvider extends ContentProvider {
|
||||
|
||||
public static final String ID_COLUMN = "_id";
|
||||
|
||||
public MockProvider(Context context) {
|
||||
super(context, null, null, null);
|
||||
}
|
||||
|
||||
// We'll store our values here
|
||||
private HashMap<String, ContentValues> mMockStore = new HashMap<String, ContentValues>();
|
||||
// And we'll generate new id's from here
|
||||
|
@ -61,7 +61,7 @@ public class MockProviderTests extends ProviderTestCase2<MockProvider> {
|
||||
super.setUp();
|
||||
mMockContext = getMockContext();
|
||||
mMockResolver = (MockContentResolver)mMockContext.getContentResolver();
|
||||
mMockResolver.addProvider(CANHAZ_AUTHORITY, new MockProvider());
|
||||
mMockResolver.addProvider(CANHAZ_AUTHORITY, new MockProvider(mMockContext));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user