Index: android_webview/javatests/src/org/chromium/android_webview/test/HttpCacheTest.java |
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/HttpCacheTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/HttpCacheTest.java |
index dd513184e159bd36c80e78aff2e734c03f7fedd4..c51ff40cb53390a085bad1f4632bbea6da77b83c 100644 |
--- a/android_webview/javatests/src/org/chromium/android_webview/test/HttpCacheTest.java |
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/HttpCacheTest.java |
@@ -4,6 +4,7 @@ |
package org.chromium.android_webview.test; |
+import android.content.Context; |
import android.test.suitebuilder.annotation.SmallTest; |
import org.chromium.android_webview.AwBrowserProcess; |
@@ -69,9 +70,9 @@ public class HttpCacheTest extends AwTestBase { |
@SmallTest |
@Feature({"AndroidWebView"}) |
public void testLegacyHttpCacheDirIsRemovedOnStartup() throws Exception { |
- ContextUtils.initApplicationContext( |
- getInstrumentation().getTargetContext().getApplicationContext()); |
- PathUtils.setPrivateDataDirectorySuffix(AwBrowserProcess.PRIVATE_DATA_DIRECTORY_SUFFIX); |
+ Context appContext = getInstrumentation().getTargetContext().getApplicationContext(); |
+ PathUtils.setPrivateDataDirectorySuffix( |
+ AwBrowserProcess.PRIVATE_DATA_DIRECTORY_SUFFIX, appContext); |
File webViewLegacyCacheDir = new File(PathUtils.getDataDirectory(), "Cache"); |
if (!webViewLegacyCacheDir.isDirectory()) { |
assertTrue(webViewLegacyCacheDir.mkdir()); |
@@ -81,6 +82,7 @@ public class HttpCacheTest extends AwTestBase { |
assertTrue(dummyCacheFile.exists()); |
// Set up JNI bindings. |
+ ContextUtils.initApplicationContext(appContext); |
AwBrowserProcess.loadLibrary(); |
// No delay before removing the legacy cache files. |
AwContentsStatics.setLegacyCacheRemovalDelayForTest(0); |