summaryrefslogtreecommitdiffstats
path: root/core/tests
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2015-01-12 16:27:04 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-01-12 16:27:04 +0000
commitf5f345cf929908bd863143815743c44778d29e4a (patch)
tree5920e6dc43bb90888f1b35e6a13821e053bb8425 /core/tests
parent9d293911221cac930eb8edfef01362ea083eeaab (diff)
parent837261cc997cbb188de05e3d1194adb91cb75825 (diff)
downloadframeworks_base-f5f345cf929908bd863143815743c44778d29e4a.zip
frameworks_base-f5f345cf929908bd863143815743c44778d29e4a.tar.gz
frameworks_base-f5f345cf929908bd863143815743c44778d29e4a.tar.bz2
am 837261cc: Merge "Fix HttpResponseCacheTest in anticipation of an OkHttp upgrade."
* commit '837261cc997cbb188de05e3d1194adb91cb75825': Fix HttpResponseCacheTest in anticipation of an OkHttp upgrade.
Diffstat (limited to 'core/tests')
-rw-r--r--core/tests/coretests/src/android/net/http/HttpResponseCacheTest.java6
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());