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

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

Issue 1911353003: [Cronet] Do not call into BidirectionalStream::SendData if stream failed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 8 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 | « components/cronet/android/test/javatests/src/org/chromium/net/BidirectionalStreamQuicTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cronet/android/test/src/org/chromium/net/QuicTestServer.java
diff --git a/components/cronet/android/test/src/org/chromium/net/QuicTestServer.java b/components/cronet/android/test/src/org/chromium/net/QuicTestServer.java
index 1344cc4d5c8114ae573571c4cdcc8ed0a5223f22..614275f04c5f98b013c69eaa96d234a0e77440c6 100644
--- a/components/cronet/android/test/src/org/chromium/net/QuicTestServer.java
+++ b/components/cronet/android/test/src/org/chromium/net/QuicTestServer.java
@@ -23,15 +23,31 @@ public final class QuicTestServer {
private static final String KEY_USED = "quic_test.example.com.key";
private static final String[] CERTS_USED = {CERT_USED};
+ private static boolean sServerRunning = false;
+
+ /*
+ * Starts the server.
+ */
public static void startQuicTestServer(Context context) {
+ if (sServerRunning) {
+ throw new IllegalStateException("Quic server is already running");
+ }
TestFilesInstaller.installIfNeeded(context);
nativeStartQuicTestServer(TestFilesInstaller.getInstalledPath(context));
sBlock.block();
+ sBlock.close();
+ sServerRunning = true;
}
+ /**
+ * Shuts down the server. No-op if the server is already shut down.
+ */
public static void shutdownQuicTestServer() {
+ if (!sServerRunning) {
+ return;
+ }
nativeShutdownQuicTestServer();
- sBlock.close();
+ sServerRunning = false;
}
public static String getServerURL() {
« no previous file with comments | « components/cronet/android/test/javatests/src/org/chromium/net/BidirectionalStreamQuicTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698