Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: content/public/android/javatests/src/org/chromium/content/browser/MediaResourceGetterTest.java

Issue 467173002: Allowing metadata to be read from blob urls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding null check Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/MediaResourceGetter.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/MediaResourceGetter.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698