diff options
author | Neil Fuller <nfuller@google.com> | 2015-01-12 14:50:33 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-01-12 14:50:36 +0000 |
commit | 837261cc997cbb188de05e3d1194adb91cb75825 (patch) | |
tree | 5920e6dc43bb90888f1b35e6a13821e053bb8425 /core/tests | |
parent | ebdfb6e8642e649f7efe877af398eae71cd9b80c (diff) | |
parent | 62d0677b0f6cc5ae48fd0b816ea5caad82264fd6 (diff) | |
download | frameworks_base-837261cc997cbb188de05e3d1194adb91cb75825.zip frameworks_base-837261cc997cbb188de05e3d1194adb91cb75825.tar.gz frameworks_base-837261cc997cbb188de05e3d1194adb91cb75825.tar.bz2 |
Merge "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()); |