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

Unified Diff: components/cronet/android/test/javatests/src/org/chromium/net/urlconnection/CronetChunkedOutputStreamTest.java

Issue 2133273002: [Cronet] Remove buffer.compact from CronetChunkedOutputStream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fixoutput
Patch Set: address Andrei's comments Created 4 years, 5 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/java/src/org/chromium/net/urlconnection/CronetChunkedOutputStream.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/javatests/src/org/chromium/net/urlconnection/CronetChunkedOutputStreamTest.java
diff --git a/components/cronet/android/test/javatests/src/org/chromium/net/urlconnection/CronetChunkedOutputStreamTest.java b/components/cronet/android/test/javatests/src/org/chromium/net/urlconnection/CronetChunkedOutputStreamTest.java
index 8cff9ddfc33c73b47f6dca7209a7c3d2f1b498c8..890be05fe0742a15ba9392a4cae0aca67f021483 100644
--- a/components/cronet/android/test/javatests/src/org/chromium/net/urlconnection/CronetChunkedOutputStreamTest.java
+++ b/components/cronet/android/test/javatests/src/org/chromium/net/urlconnection/CronetChunkedOutputStreamTest.java
@@ -225,4 +225,24 @@ public class CronetChunkedOutputStreamTest extends CronetTestBase {
TestUtil.checkLargeData(TestUtil.getResponseAsString(connection));
connection.disconnect();
}
+
+ @SmallTest
+ @Feature({"Cronet"})
+ @OnlyRunCronetHttpURLConnection
+ // Regression testing for crbug.com/618872.
+ public void testOneMassiveWriteLargerThanInternalBuffer() throws Exception {
+ URL url = new URL(NativeTestServer.getEchoBodyURL());
+ HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+ connection.setDoOutput(true);
+ connection.setRequestMethod("POST");
+ // Use a super big chunk size so that it exceeds the UploadDataProvider
+ // read buffer size.
+ byte[] largeData = TestUtil.getLargeData();
+ connection.setChunkedStreamingMode(largeData.length);
+ OutputStream out = connection.getOutputStream();
+ out.write(largeData);
+ assertEquals(200, connection.getResponseCode());
+ TestUtil.checkLargeData(TestUtil.getResponseAsString(connection));
+ connection.disconnect();
+ }
}
« no previous file with comments | « components/cronet/android/java/src/org/chromium/net/urlconnection/CronetChunkedOutputStream.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698