From 8e34203c41f2f38f9d58547881bb4febd7c07bc7 Mon Sep 17 00:00:00 2001 From: Makoto Onuki Date: Tue, 7 Sep 2010 14:27:25 -0700 Subject: 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 --- test-runner/src/android/test/ProviderTestCase2.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 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 extends Andro // one created through the regular Context return getContext().getDir("mockcontext2_" + name, mode); } + + @Override + public Context getApplicationContext() { + return this; + } } /** * Constructor. -- cgit v1.1