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

Side by Side Diff: components/cronet/android/test/javatests/src/org/chromium/net/TestBidirectionalStreamCallback.java

Issue 1777083002: Make QuicSimpleServerStream supports multipart response body (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@quicsmaller
Patch Set: Rebased Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.net; 5 package org.chromium.net;
6 6
7 import android.os.ConditionVariable; 7 import android.os.ConditionVariable;
8 8
9 import static junit.framework.Assert.assertEquals; 9 import static junit.framework.Assert.assertEquals;
10 import static junit.framework.Assert.assertFalse; 10 import static junit.framework.Assert.assertFalse;
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 } 211 }
212 212
213 @Override 213 @Override
214 public void onResponseTrailersReceived(BidirectionalStream stream, UrlRespon seInfo info, 214 public void onResponseTrailersReceived(BidirectionalStream stream, UrlRespon seInfo info,
215 UrlResponseInfo.HeaderBlock trailers) { 215 UrlResponseInfo.HeaderBlock trailers) {
216 assertEquals(mExecutorThread, Thread.currentThread()); 216 assertEquals(mExecutorThread, Thread.currentThread());
217 assertFalse(stream.isDone()); 217 assertFalse(stream.isDone());
218 assertNull(mError); 218 assertNull(mError);
219 mResponseStep = ResponseStep.ON_TRAILERS; 219 mResponseStep = ResponseStep.ON_TRAILERS;
220 mTrailers = trailers; 220 mTrailers = trailers;
221 assertTrue(mTrailers != null);
221 if (maybeThrowCancelOrPause(stream, mReadStepBlock)) { 222 if (maybeThrowCancelOrPause(stream, mReadStepBlock)) {
222 return; 223 return;
223 } 224 }
224 } 225 }
225 226
226 @Override 227 @Override
227 public void onSucceeded(BidirectionalStream stream, UrlResponseInfo info) { 228 public void onSucceeded(BidirectionalStream stream, UrlResponseInfo info) {
228 assertEquals(mExecutorThread, Thread.currentThread()); 229 assertEquals(mExecutorThread, Thread.currentThread());
229 assertTrue(stream.isDone()); 230 assertTrue(stream.isDone());
230 assertTrue(mResponseStep == ResponseStep.ON_RESPONSE_STARTED 231 assertTrue(mResponseStep == ResponseStep.ON_RESPONSE_STARTED
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 }; 326 };
326 if (mFailureType == FailureType.CANCEL_ASYNC 327 if (mFailureType == FailureType.CANCEL_ASYNC
327 || mFailureType == FailureType.CANCEL_ASYNC_WITHOUT_PAUSE) { 328 || mFailureType == FailureType.CANCEL_ASYNC_WITHOUT_PAUSE) {
328 getExecutor().execute(task); 329 getExecutor().execute(task);
329 } else { 330 } else {
330 task.run(); 331 task.run();
331 } 332 }
332 return mFailureType != FailureType.CANCEL_ASYNC_WITHOUT_PAUSE; 333 return mFailureType != FailureType.CANCEL_ASYNC_WITHOUT_PAUSE;
333 } 334 }
334 } 335 }
OLDNEW
« no previous file with comments | « components/cronet/android/cronet_bidirectional_stream_adapter.cc ('k') | components/cronet/android/test/quic_test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698