diff options
author | Neil Fuller <nfuller@google.com> | 2015-01-12 16:44:36 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-01-12 16:44:36 +0000 |
commit | 60b268f039857211333e2ea1cc68e795a12d7e07 (patch) | |
tree | 4a3a5cc905075ad8aeb653319753304e29c0a7c8 /core/tests | |
parent | 0f8ecc84c8b86054bfd3275f942c3a705df01fbb (diff) | |
parent | f5f345cf929908bd863143815743c44778d29e4a (diff) | |
download | frameworks_base-60b268f039857211333e2ea1cc68e795a12d7e07.zip frameworks_base-60b268f039857211333e2ea1cc68e795a12d7e07.tar.gz frameworks_base-60b268f039857211333e2ea1cc68e795a12d7e07.tar.bz2 |
am f5f345cf: am 837261cc: Merge "Fix HttpResponseCacheTest in anticipation of an OkHttp upgrade."
* commit 'f5f345cf929908bd863143815743c44778d29e4a':
Fix HttpResponseCacheTest in anticipation of an OkHttp upgrade.
Diffstat (limited to 'core/tests')
-rw-r--r-- | core/tests/coretests/src/android/net/http/HttpResponseCacheTest.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/tests/coretests/src/android/net/http/HttpResponseCacheTest.java b/core/tests/coretests/src/android/net/http/HttpResponseCacheTest.java index 9015a6f..0421d44 100644 --- a/core/tests/coretests/src/android/net/http/HttpResponseCacheTest.java +++ b/core/tests/coretests/src/android/net/http/HttpResponseCacheTest.java @@ -19,6 +19,7 @@ package android.net.http; import com.google.mockwebserver.MockResponse; import com.google.mockwebserver.MockWebServer; import java.io.File; +import java.io.InputStream; import java.net.CacheRequest; import java.net.CacheResponse; import java.net.ResponseCache; @@ -118,7 +119,10 @@ public final class HttpResponseCacheTest extends TestCase { server.play(); URLConnection c1 = server.getUrl("/").openConnection(); - assertEquals('A', c1.getInputStream().read()); + InputStream inputStream1 = c1.getInputStream(); + assertEquals('A', inputStream1.read()); + inputStream1.close(); + assertEquals(1, cache.getRequestCount()); assertEquals(1, cache.getNetworkCount()); assertEquals(0, cache.getHitCount()); |