Index: content/public/android/javatests/src/org/chromium/content/browser/MediaResourceGetterTest.java |
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/MediaResourceGetterTest.java b/content/public/android/javatests/src/org/chromium/content/browser/MediaResourceGetterTest.java |
index 7eae2d653793082d92db1cfe7b9389deaa345595..b9f338fc62a2a5b93f4fe3504f3c972cee1c7215 100644 |
--- a/content/public/android/javatests/src/org/chromium/content/browser/MediaResourceGetterTest.java |
+++ b/content/public/android/javatests/src/org/chromium/content/browser/MediaResourceGetterTest.java |
@@ -426,6 +426,46 @@ public class MediaResourceGetterTest extends InstrumentationTestCase { |
} |
@SmallTest |
+ public void testConfigure_Blob_Disallow_Null_Cache() { |
+ final String path = "/data/data/" + null + "/cache/"; |
+ final String url = path; |
+ mFakeMRG.mFileExists = true; |
+ mFakeMRG.mThrowExceptionInConfigure = true; |
+ assertFalse(mFakeMRG.configure(mMockContext, url, "", null)); |
+ assertNull(mFakeMRG.mPath); |
+ } |
+ |
+ @SmallTest |
+ public void testConfigure_Blob_Disallowed_Incomplete_Path() { |
+ final String path = "/data/data/"; |
+ final String url = path; |
+ mFakeMRG.mFileExists = true; |
+ mFakeMRG.mThrowExceptionInConfigure = true; |
+ assertFalse(mFakeMRG.configure(mMockContext, url, "", null)); |
+ assertNull(mFakeMRG.mPath); |
+ } |
+ |
+ @SmallTest |
+ public void testConfigure_Blob_Disallowed_Unknown_Path() { |
+ final String path = "/unknown/path/"; |
+ final String url = path; |
+ mFakeMRG.mFileExists = true; |
+ mFakeMRG.mThrowExceptionInConfigure = true; |
+ assertFalse(mFakeMRG.configure(mMockContext, url, "", null)); |
+ assertNull(mFakeMRG.mPath); |
+ } |
+ |
+ @SmallTest |
+ public void testConfigure_Blob_Disallowed_Other_Application() { |
+ final String path = "/data/data/org.some.other.app/cache/"; |
+ final String url = path; |
+ mFakeMRG.mFileExists = true; |
+ mFakeMRG.mThrowExceptionInConfigure = true; |
+ assertFalse(mFakeMRG.configure(mMockContext, url, "", null)); |
+ assertNull(mFakeMRG.mPath); |
+ } |
+ |
+ @SmallTest |
public void testExtract_NoMetadata() { |
mFakeMRG.mFileExists = true; |
assertEquals(sEmptyMetadata, mFakeMRG.extract( |