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

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

Issue 1650773003: Revert of [Cronet] Get Cronet performance test running again (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/CronetTestUtil.java
diff --git a/components/cronet/android/test/src/org/chromium/net/CronetTestUtil.java b/components/cronet/android/test/src/org/chromium/net/CronetTestUtil.java
index 14b1bc98b89c61f52bb894fed627b0cdb6fdd4c8..745d10a57f978f05e834e8a590502ebf634bb096 100644
--- a/components/cronet/android/test/src/org/chromium/net/CronetTestUtil.java
+++ b/components/cronet/android/test/src/org/chromium/net/CronetTestUtil.java
@@ -4,9 +4,6 @@
package org.chromium.net;
-import android.os.ConditionVariable;
-
-import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
/**
@@ -14,45 +11,13 @@
*/
@JNINamespace("cronet")
public class CronetTestUtil {
- private static final ConditionVariable sHostResolverBlock = new ConditionVariable();
-
/**
- * Registers customized DNS mapping for testing host names used by test servers, namely:
- * <ul>
- * <li>{@link QuicTestServer#getServerHost}</li>
- * <li>{@link NativeTestServer#getSdchURL}</li>'s host
- * </ul>
- * @param cronetEngine {@link CronetEngine} that this mapping should apply to.
- * @param destination host to map to (e.g. 127.0.0.1)
+ * Start QUIC server on local host.
+ * @return non-zero QUIC server port number on success or 0 if failed.
*/
- public static void registerHostResolverProc(CronetEngine cronetEngine, String destination) {
- long contextAdapter =
- ((CronetUrlRequestContext) cronetEngine).getUrlRequestContextAdapter();
- nativeRegisterHostResolverProc(contextAdapter, false, destination);
- sHostResolverBlock.block();
- sHostResolverBlock.close();
+ public static int startQuicServer() {
+ return nativeStartQuicServer();
}
- /**
- * Registers customized DNS mapping for testing host names used by test servers.
- * @param requestFactory {@link HttpUrlRequestFactory} that this mapping should apply to.
- * @param destination host to map to (e.g. 127.0.0.1)
- */
- public static void registerHostResolverProc(
- HttpUrlRequestFactory requestFactory, String destination) {
- long contextAdapter = ((ChromiumUrlRequestFactory) requestFactory)
- .getRequestContext()
- .getUrlRequestContextAdapter();
- nativeRegisterHostResolverProc(contextAdapter, true, destination);
- sHostResolverBlock.block();
- sHostResolverBlock.close();
- }
-
- @CalledByNative
- private static void onHostResolverProcRegistered() {
- sHostResolverBlock.open();
- }
-
- private static native void nativeRegisterHostResolverProc(
- long contextAdapter, boolean isLegacyAPI, String destination);
+ private static native int nativeStartQuicServer();
}

Powered by Google App Engine
This is Rietveld 408576698