diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-07-28 17:42:53 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-07-28 17:42:53 -0700 |
commit | bfefdcda94e056f6dee68debefb35ce9e7cd03b7 (patch) | |
tree | bbd7b777cd8b1f62aafed27a00e60bcc2440295f /test-runner/android | |
parent | 3eb434487825b7ced55527dc50dd3957dfe187b6 (diff) | |
parent | 04cc0e121f0f9fb236150be5e9afa1b8d0105026 (diff) | |
download | frameworks_base-bfefdcda94e056f6dee68debefb35ce9e7cd03b7.zip frameworks_base-bfefdcda94e056f6dee68debefb35ce9e7cd03b7.tar.gz frameworks_base-bfefdcda94e056f6dee68debefb35ce9e7cd03b7.tar.bz2 |
Merge change 8886
* changes:
Fix broken calendar tests.
Diffstat (limited to 'test-runner/android')
-rw-r--r-- | test-runner/android/test/ProviderTestCase2.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test-runner/android/test/ProviderTestCase2.java b/test-runner/android/test/ProviderTestCase2.java index ac17ebf..a923d2a 100644 --- a/test-runner/android/test/ProviderTestCase2.java +++ b/test-runner/android/test/ProviderTestCase2.java @@ -3,6 +3,7 @@ package android.test; import android.content.ContentProvider; import android.content.ContentResolver; import android.content.Context; +import android.content.res.Resources; import android.test.mock.MockContext; import android.test.mock.MockContentResolver; import android.database.DatabaseUtils; @@ -26,6 +27,14 @@ public abstract class ProviderTestCase2<T extends ContentProvider> extends Andro private IsolatedContext mProviderContext; private MockContentResolver mResolver; + private class MockContext2 extends MockContext { + + @Override + public Resources getResources() { + return getContext().getResources(); + } + } + public ProviderTestCase2(Class<T> providerClass, String providerAuthority) { mProviderClass = providerClass; mProviderAuthority = providerAuthority; @@ -47,7 +56,7 @@ public abstract class ProviderTestCase2<T extends ContentProvider> extends Andro mResolver = new MockContentResolver(); final String filenamePrefix = "test."; RenamingDelegatingContext targetContextWrapper = new RenamingDelegatingContext( - new MockContext(), // The context that most methods are delegated to + new MockContext2(), // The context that most methods are delegated to getContext(), // The context that file methods are delegated to filenamePrefix); mProviderContext = new IsolatedContext(mResolver, targetContextWrapper); |