summaryrefslogtreecommitdiffstats
path: root/luni
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2014-03-03 11:39:58 +0000
committerNeil Fuller <nfuller@google.com>2014-03-03 13:49:33 +0000
commit9749b98a92fbf2bfe095b7ec884789f62ab293d8 (patch)
treeb5065da7dd23b4175ec35e3c6ade49fe4949a609 /luni
parent4189a6e183e8c38992df6de29321733fad06e50a (diff)
downloadlibcore-9749b98a92fbf2bfe095b7ec884789f62ab293d8.zip
libcore-9749b98a92fbf2bfe095b7ec884789f62ab293d8.tar.gz
libcore-9749b98a92fbf2bfe095b7ec884789f62ab293d8.tar.bz2
Fix URLConnectionTest#testSetChunkedStreamingMode
Commit 60f79119fd7e37c459a96888594f90d86bab5535 broke it - until OkHttp is upgraded the chunkLength is obeyed. The argument needs to be >= 8 for the test to pass. Change-Id: I22acaa4a56fdbd22abc075a2300cf53e303ec791
Diffstat (limited to 'luni')
-rw-r--r--luni/src/test/java/libcore/java/net/URLConnectionTest.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/luni/src/test/java/libcore/java/net/URLConnectionTest.java b/luni/src/test/java/libcore/java/net/URLConnectionTest.java
index bda8aff..906dbe0 100644
--- a/luni/src/test/java/libcore/java/net/URLConnectionTest.java
+++ b/luni/src/test/java/libcore/java/net/URLConnectionTest.java
@@ -1072,7 +1072,11 @@ public final class URLConnectionTest extends TestCase {
server.play();
HttpURLConnection urlConnection = (HttpURLConnection) server.getUrl("/").openConnection();
- urlConnection.setChunkedStreamingMode(1);
+ // Later releases of Android ignore the value for chunkLength if it is > 0 and default to
+ // a fixed chunkLength. During the change-over period while the chunkLength indicates the
+ // chunk buffer size (inc. header) the chunkLength has to be >= 8. This enables the flush()
+ // to dictate the size of the chunks.
+ urlConnection.setChunkedStreamingMode(50 /* chunkLength */);
urlConnection.setDoOutput(true);
OutputStream outputStream = urlConnection.getOutputStream();
String outputString = "ABCDEFGH";