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

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

Issue 2247773002: [Cronet] Fix testDestroyUploadDataStreamAdapterOnSucceededCallback flake. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self review Created 4 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 import android.test.MoreAsserts; 8 import android.test.MoreAsserts;
9 import android.test.suitebuilder.annotation.SmallTest; 9 import android.test.suitebuilder.annotation.SmallTest;
10 import android.util.Log; 10 import android.util.Log;
(...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after
1717 final ConditionVariable uploadDataStreamAdapterDestroyed = new Condition Variable(); 1717 final ConditionVariable uploadDataStreamAdapterDestroyed = new Condition Variable();
1718 request.setOnDestroyedUploadCallbackForTesting(new Runnable() { 1718 request.setOnDestroyedUploadCallbackForTesting(new Runnable() {
1719 @Override 1719 @Override
1720 public void run() { 1720 public void run() {
1721 uploadDataStreamAdapterDestroyed.open(); 1721 uploadDataStreamAdapterDestroyed.open();
1722 } 1722 }
1723 }); 1723 });
1724 1724
1725 request.start(); 1725 request.start();
1726 uploadDataStreamAdapterDestroyed.block(); 1726 uploadDataStreamAdapterDestroyed.block();
1727 callback.blockForDone();
1727 1728
1728 assertEquals(200, callback.mResponseInfo.getHttpStatusCode()); 1729 assertEquals(200, callback.mResponseInfo.getHttpStatusCode());
1729 assertEquals("", callback.mResponseAsString); 1730 assertEquals("", callback.mResponseAsString);
1730 } 1731 }
1731 1732
1732 /* 1733 /*
1733 * Verifies error codes are passed through correctly. 1734 * Verifies error codes are passed through correctly.
1734 */ 1735 */
1735 @SmallTest 1736 @SmallTest
1736 @Feature({"Cronet"}) 1737 @Feature({"Cronet"})
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
1813 private String bufferContentsToString(ByteBuffer byteBuffer, int start, int end) { 1814 private String bufferContentsToString(ByteBuffer byteBuffer, int start, int end) {
1814 // Use a duplicate to avoid modifying byteBuffer. 1815 // Use a duplicate to avoid modifying byteBuffer.
1815 ByteBuffer duplicate = byteBuffer.duplicate(); 1816 ByteBuffer duplicate = byteBuffer.duplicate();
1816 duplicate.position(start); 1817 duplicate.position(start);
1817 duplicate.limit(end); 1818 duplicate.limit(end);
1818 byte[] contents = new byte[duplicate.remaining()]; 1819 byte[] contents = new byte[duplicate.remaining()];
1819 duplicate.get(contents); 1820 duplicate.get(contents);
1820 return new String(contents); 1821 return new String(contents);
1821 } 1822 }
1822 } 1823 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698