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(); |
} |