summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2015-01-20 12:51:03 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-01-20 12:51:03 +0000
commit9005bec99aa9ec43b1ff7cfb84df6fe12c84ced5 (patch)
treeac3f8f363ed1b72ac49b9904df7abce1bece21e1
parent8602c015f60df0b7385580407d1c75d7c47f9a71 (diff)
parent764ea3d867b544de457aac2d02327d7b796d4a5c (diff)
downloadlibcore-9005bec99aa9ec43b1ff7cfb84df6fe12c84ced5.zip
libcore-9005bec99aa9ec43b1ff7cfb84df6fe12c84ced5.tar.gz
libcore-9005bec99aa9ec43b1ff7cfb84df6fe12c84ced5.tar.bz2
Merge "Changes needed to support OkHttp upgrade"
-rw-r--r--expectations/knownfailures.txt43
-rw-r--r--luni/src/test/java/libcore/java/net/URLConnectionTest.java6
2 files changed, 7 insertions, 42 deletions
diff --git a/expectations/knownfailures.txt b/expectations/knownfailures.txt
index cf93bab..0526b64 100644
--- a/expectations/knownfailures.txt
+++ b/expectations/knownfailures.txt
@@ -1454,46 +1454,11 @@
name: "org.apache.harmony.tests.java.util.GregorianCalendarTest#test_computeTime"
},
{
- description: "SpdyConnection issue https://github.com/square/okhttp/issues/644 crashes the test app. Android does not provide SPDY/HTTP_2 connections by default so have been suppressed.",
- bug: 14462336,
+ description: "OkHttp tests require SOCKS 5 support. Android PlainSocketImpl implements SOCKS 4",
+ bug: 96926,
names: [
- "com.squareup.okhttp.ConnectionPoolTest",
- "com.squareup.okhttp.internal.spdy.SpdyConnectionTest",
- "com.squareup.okhttp.internal.http.HttpOverHttp20Draft09Test",
- "com.squareup.okhttp.internal.http.HttpOverSpdy3Test",
- "com.squareup.okhttp.internal.http.URLConnectionTest#npnSetsProtocolHeader_SPDY_3",
- "com.squareup.okhttp.internal.http.URLConnectionTest#npnSetsProtocolHeader_HTTP_2",
- "com.squareup.okhttp.internal.http.URLConnectionTest#zeroLengthPost_SPDY_3",
- "com.squareup.okhttp.internal.http.URLConnectionTest#zeroLengthPost_HTTP_2",
- "com.squareup.okhttp.internal.http.URLConnectionTest#zeroLengthPut_SPDY_3",
- "com.squareup.okhttp.internal.http.URLConnectionTest#zeroLengthPut_HTTP_2"
- ]
-},
-{
- description: "Some OkHttp tests were written before the introduction of TLS_FALLBACK_SCSV and have only been fixed for APIs used by Android",
- bug: 17962997,
- names: [
- "com.squareup.okhttp.SyncApiTest#recoverFromTlsHandshakeFailure",
- "com.squareup.okhttp.AsyncApiTest#recoverFromTlsHandshakeFailure"
- ]
-},
-{
- description: "JavaApiConverterTest#createOkResponse_fromJavaHttpsUrlConnection works independently but fails when run with some other test(s).",
- bug: 17962997,
- name: "com.squareup.okhttp.internal.http.JavaApiConverterTest#createOkResponse_fromJavaHttpsUrlConnection"
-},
-{
- description: "Okhttp test hardcodes the TLS version expected.",
- bug: 14462336,
- names: [
- "com.squareup.okhttp.internal.http.URLConnectionTest#sslFallbackNotUsedWhenRecycledConnectionFails"
- ]
-},
-{
- description: "The test relies on SimpleDateFormat zzz producing GMT not GMT+00:00 as it does on Android. Android issue 66136.",
- bug: 14462336,
- names: [
- "com.squareup.okhttp.internal.http.HttpResponseCacheTest#setIfModifiedSince"
+ "com.squareup.okhttp.SocksProxyTest#proxy",
+ "com.squareup.okhttp.SocksProxyTest#proxySelector"
]
},
{
diff --git a/luni/src/test/java/libcore/java/net/URLConnectionTest.java b/luni/src/test/java/libcore/java/net/URLConnectionTest.java
index 8991b1a..2269011 100644
--- a/luni/src/test/java/libcore/java/net/URLConnectionTest.java
+++ b/luni/src/test/java/libcore/java/net/URLConnectionTest.java
@@ -16,7 +16,7 @@
package libcore.java.net;
-import com.android.okhttp.HttpResponseCache;
+import com.android.okhttp.AndroidShimResponseCache;
import com.google.mockwebserver.MockResponse;
import com.google.mockwebserver.MockWebServer;
@@ -88,7 +88,7 @@ import static com.google.mockwebserver.SocketPolicy.SHUTDOWN_OUTPUT_AT_END;
public final class URLConnectionTest extends AbstractResourceLeakageDetectorTestCase {
private MockWebServer server;
- private HttpResponseCache cache;
+ private AndroidShimResponseCache cache;
private String hostName;
@Override protected void setUp() throws Exception {
@@ -678,7 +678,7 @@ public final class URLConnectionTest extends AbstractResourceLeakageDetectorTest
private void initResponseCache() throws IOException {
String tmp = System.getProperty("java.io.tmpdir");
File cacheDir = new File(tmp, "HttpCache-" + UUID.randomUUID());
- cache = new HttpResponseCache(cacheDir, Integer.MAX_VALUE);
+ cache = AndroidShimResponseCache.create(cacheDir, Integer.MAX_VALUE);
ResponseCache.setDefault(cache);
}