diff options
author | Makoto Onuki <omakoto@google.com> | 2010-09-07 14:27:25 -0700 |
---|---|---|
committer | Makoto Onuki <omakoto@google.com> | 2010-09-07 14:27:25 -0700 |
commit | 8e34203c41f2f38f9d58547881bb4febd7c07bc7 (patch) | |
tree | af4aeda8ef3a609a30cc79e10498c65e5b35e959 /test-runner/src | |
parent | ed4fbd98d05a368ea17d6759f262b3547406c8c5 (diff) | |
download | frameworks_base-8e34203c41f2f38f9d58547881bb4febd7c07bc7.zip frameworks_base-8e34203c41f2f38f9d58547881bb4febd7c07bc7.tar.gz frameworks_base-8e34203c41f2f38f9d58547881bb4febd7c07bc7.tar.bz2 |
Add getApplicationContext to the mock implementation.
So that it'll be compatible with Loaders, which uses this method.
(Otherwise MockContext.getApplicationContext(), which just throws
an exception, will be used.)
Change-Id: I529b60466cf086b514fcddbef4583d1c5b750b9c
Diffstat (limited to 'test-runner/src')
-rw-r--r-- | test-runner/src/android/test/ProviderTestCase2.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test-runner/src/android/test/ProviderTestCase2.java b/test-runner/src/android/test/ProviderTestCase2.java index 64d11c5..2811b0d 100644 --- a/test-runner/src/android/test/ProviderTestCase2.java +++ b/test-runner/src/android/test/ProviderTestCase2.java @@ -74,7 +74,7 @@ public abstract class ProviderTestCase2<T extends ContentProvider> extends Andro private IsolatedContext mProviderContext; private MockContentResolver mResolver; - private class MockContext2 extends MockContext { + private class MockContext2 extends MockContext { @Override public Resources getResources() { @@ -87,6 +87,11 @@ public abstract class ProviderTestCase2<T extends ContentProvider> extends Andro // one created through the regular Context return getContext().getDir("mockcontext2_" + name, mode); } + + @Override + public Context getApplicationContext() { + return this; + } } /** * Constructor. |