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

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

Issue 289653002: Skip network availabity check for localhost in MediaResourceGetter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added the tests. Created 6 years, 7 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 b1fa44195f40b2291ac4bfa115c02d17d8c4b4d8..f8cd4a7a3226b9fb595bece8a50b64141f088037 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
@@ -336,6 +336,24 @@ public class MediaResourceGetterTest extends InstrumentationTestCase {
}
@SmallTest
+ public void testConfigure_Net_Allowed_LocalHost_WithNoNetwork() {
+ String[] localHostUrls = {
+ "http://LocalHost",
+ "https://127.0.0.1/",
+ "http://[::1]:8888/",
+ };
+ mMockContext.allowPermission = true;
+ mFakeMRG.mNetworkType = null;
+ for (String localHostUrl : localHostUrls) {
+ assertTrue(mFakeMRG.configure(mMockContext, localHostUrl,
+ TEST_COOKIES, TEST_USER_AGENT));
+ assertEquals(localHostUrl, mFakeMRG.mUri);
+ assertEquals(sHeadersCookieAndUA, mFakeMRG.mHeaders);
+ assertNull(mFakeMRG.mPath);
+ }
+ }
+
+ @SmallTest
public void testConfigure_File_Allowed_MntSdcard() {
final String path = "/mnt/sdcard/test";
final String url = "file://" + path;
@@ -501,4 +519,4 @@ public class MediaResourceGetterTest extends InstrumentationTestCase {
assertTrue(MediaResourceGetter.androidDeviceOk(
"Happy Device", android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH));
}
-}
+}
« 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