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

Unified Diff: components/cronet/android/test/src/org/chromium/net/NativeTestServer.java

Issue 1817553002: Add host resolver rules experimental flag for Cronet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: delete unused definitions, rebase, and fix test Created 4 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
Index: components/cronet/android/test/src/org/chromium/net/NativeTestServer.java
diff --git a/components/cronet/android/test/src/org/chromium/net/NativeTestServer.java b/components/cronet/android/test/src/org/chromium/net/NativeTestServer.java
index db94b70f99baed3475183f1d4a17cb3312b5c557..37f8032e9786e4556e3835e6ee536b3315d0d09a 100644
--- a/components/cronet/android/test/src/org/chromium/net/NativeTestServer.java
+++ b/components/cronet/android/test/src/org/chromium/net/NativeTestServer.java
@@ -9,6 +9,9 @@ import android.content.Context;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.base.test.util.UrlUtils;
+import java.net.MalformedURLException;
+import java.net.URL;
+
/**
* Wrapper class to start an in-process native test server, and get URLs
* needed to talk to it.
@@ -52,8 +55,8 @@ public final class NativeTestServer {
return nativeGetFileURL(filePath);
}
- public static String getSdchURL() {
- return nativeGetSdchURL();
+ public static String getSdchURL() throws MalformedURLException {
+ return new URL("http", CronetTestUtil.SDCH_FAKE_HOST, getPort(), "").toString();
}
// Returns a URL that the server will return an Exabyte of data
@@ -80,6 +83,10 @@ public final class NativeTestServer {
return nativeGetFileURL("/notfound.html");
}
+ public static int getPort() {
+ return nativeGetPort();
+ }
+
public static String getHostPort() {
return nativeGetHostPort();
}
@@ -96,8 +103,8 @@ public final class NativeTestServer {
private static native String nativeGetEchoMethodURL();
private static native String nativeGetRedirectToEchoBody();
private static native String nativeGetFileURL(String filePath);
- private static native String nativeGetSdchURL();
private static native String nativeGetExabyteResponseURL();
private static native String nativeGetHostPort();
+ private static native int nativeGetPort();
private static native boolean nativeIsDataReductionProxySupported();
}

Powered by Google App Engine
This is Rietveld 408576698