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
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.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 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) {