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 e6f5ef04884cf5e7c919b32f7e23f7c62c477096..bee223bf87ca732340052d514110c3111e65299a 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(); |
pauljensen
2016/07/26 18:18:51
Can we go back to this old code so we don't have t
mgersh
2016/07/27 21:14:58
I don't understand the complaint. I moved "fake.sd
pauljensen
2016/08/17 12:54:26
GetSdchURL() is defined in native_test_server.cc.
|
+ public static String getSdchURL() throws MalformedURLException { |
+ return new URL("http", CronetTestUtil.SDCH_FAKE_HOST, getPort(), "").toString(); |
} |
// The following URLs will make NativeTestServer serve a response based on |
@@ -75,6 +78,10 @@ public final class NativeTestServer { |
return nativeGetFileURL("/notfound.html"); |
} |
+ public static int getPort() { |
+ return nativeGetPort(); |
+ } |
+ |
public static String getHostPort() { |
return nativeGetHostPort(); |
} |
@@ -91,7 +98,7 @@ 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 nativeGetHostPort(); |
+ private static native int nativeGetPort(); |
private static native boolean nativeIsDataReductionProxySupported(); |
} |