diff options
author | Paul Westbrook <pwestbro@google.com> | 2010-02-11 10:33:12 -0800 |
---|---|---|
committer | Paul Westbrook <pwestbro@google.com> | 2010-02-11 14:09:10 -0800 |
commit | 1048108f1f57c96f746241b36b5181ff6cd0a8ee (patch) | |
tree | ae207a22753243e8e12cd725d64b4e11ca810653 /test-runner | |
parent | 575c6710a38f608aca2c25e7784674a47d18a871 (diff) | |
download | frameworks_base-1048108f1f57c96f746241b36b5181ff6cd0a8ee.zip frameworks_base-1048108f1f57c96f746241b36b5181ff6cd0a8ee.tar.gz frameworks_base-1048108f1f57c96f746241b36b5181ff6cd0a8ee.tar.bz2 |
Fix some Gmail tests
The SSLSessionCache attempts to create a directory through the context
In MockContext, this throws an UnsupportedOperationExcetion
This CL changes MockContext2 in ProviderTestCase2 to allow getDir
to be called, but the directory is named so it will be seperated from
a directory created by a regular context
Diffstat (limited to 'test-runner')
-rw-r--r-- | test-runner/android/test/ProviderTestCase2.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test-runner/android/test/ProviderTestCase2.java b/test-runner/android/test/ProviderTestCase2.java index a923d2a..f3655fc 100644 --- a/test-runner/android/test/ProviderTestCase2.java +++ b/test-runner/android/test/ProviderTestCase2.java @@ -8,6 +8,8 @@ import android.test.mock.MockContext; import android.test.mock.MockContentResolver; import android.database.DatabaseUtils; +import java.io.File; + /** * This TestCase class provides a framework for isolated testing of a single * ContentProvider. It uses a {@link android.test.mock.MockContentResolver} to @@ -33,6 +35,13 @@ public abstract class ProviderTestCase2<T extends ContentProvider> extends Andro public Resources getResources() { return getContext().getResources(); } + + @Override + public File getDir(String name, int mode) { + // name the directory so the directory will be seperated from + // one created through the regular Context + return getContext().getDir("mockcontext2_" + name, mode); + } } public ProviderTestCase2(Class<T> providerClass, String providerAuthority) { |