diff options
| author | android-build-team Robot <android-build-team-robot@google.com> | 2020-04-28 20:23:04 +0000 |
|---|---|---|
| committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-04-28 20:23:04 +0000 |
| commit | b8cbd66bfdc54ad471d5a64cb01a7b3f4acfaa3a (patch) | |
| tree | 2096e584e41656b04212191fe16cc21c998ab17a | |
| parent | 2e729f790bd5e214890bbfbe9fd5516d4a025196 (diff) | |
| parent | 53374571791627328cb9c43558ad73f5d997eba1 (diff) | |
| download | platform_external_okhttp-android10-mainline-tzdata-release.tar.gz platform_external_okhttp-android10-mainline-tzdata-release.tar.bz2 platform_external_okhttp-android10-mainline-tzdata-release.zip | |
Snap for 6439596 from 53374571791627328cb9c43558ad73f5d997eba1 to qt-aml-tzdata-releaseandroid-mainline-10.0.0_r11android10-mainline-tzdata-release
Change-Id: I79715e63e26d8ee886ef051d09b6a68502a410fb
19 files changed, 23 insertions, 197 deletions
@@ -14,27 +14,17 @@ // limitations under the License. // -package { - default_visibility: ["//visibility:private"], -} - // The source files that contribute to Android's core library APIs. filegroup { name: "okhttp_api_files", - visibility: ["//libcore"], // Use the repackaged version of android as that is what is used by Android core library // APIs. srcs: ["repackaged/android/src/main/java/com/android/okhttp/internalandroidapi/**/*.java"], } -nojarjar_visibility = [ - "//cts/tests/libcore/okhttp", -] - // non-jarjar'd version of okhttp to compile the tests against java_library { name: "okhttp-nojarjar", - visibility: nojarjar_visibility, srcs: [ "android/src/main/java/**/*.java", "okhttp/src/main/java/**/*.java", @@ -46,21 +36,18 @@ java_library { hostdex: true, - sdk_version: "none", - system_modules: "core-all-system-modules", + no_standard_libs: true, libs: [ - "conscrypt.module.intra.core.api.stubs", + "core-all", + // TODO(b/129126571): Depend on Conscrypt stubs instead + "conscrypt", ], + system_modules: "core-all-system-modules", java_version: "1.7", } java_library { name: "okhttp", - visibility: [ - "//art/build/apex", - "//external/robolectric-shadows", - "//libcore", - ], srcs: [ // Although some of the classes in the android/ directory are already in the correct // package and do not need to be moved to another package they are transformed as they @@ -75,11 +62,13 @@ java_library { hostdex: true, installable: true, - sdk_version: "none", - system_modules: "core-all-system-modules", + no_standard_libs: true, libs: [ - "conscrypt.module.intra.core.api.stubs", + "core-all", + // TODO(b/129126571): Depend on Conscrypt stubs instead + "conscrypt", ], + system_modules: "core-all-system-modules", java_version: "1.7", } @@ -88,27 +77,25 @@ java_library { // not be stripped. See b/24535627. java_library { name: "okhttp-testdex", - visibility: [ - "//art:__subpackages__", - ], static_libs: ["okhttp"], installable: true, - sdk_version: "none", - system_modules: "core-all-system-modules", + no_standard_libs: true, libs: [ - "conscrypt.module.intra.core.api.stubs", + "core-all", + // TODO(b/129126571): Depend on Conscrypt stubs instead + "conscrypt", ], dex_preopt: { enabled: false, }, + system_modules: "core-all-system-modules", java_version: "1.7", } -java_library { +java_library_static { name: "okhttp-tests-nojarjar", - visibility: nojarjar_visibility, srcs: [ "android/test/java/**/*.java", "okhttp-android-support/src/test/java/**/*.java", @@ -124,14 +111,15 @@ java_library { // Exclude test Android currently has problems with due to @Parameterized (requires JUnit 4.11). exclude_srcs: ["okhttp-tests/src/test/java/com/squareup/okhttp/WebPlatformUrlTest.java"], - sdk_version: "none", - system_modules: "core-all-system-modules", + no_standard_libs: true, libs: [ + "core-all", "okhttp-nojarjar", "junit", - "conscrypt.module.intra.core.api.stubs", + "conscrypt", "bouncycastle-unbundled", ], + system_modules: "core-all-system-modules", java_version: "1.7", } @@ -1,3 +1,3 @@ -# Bug component: 24949 +nfuller@google.com tobiast@google.com -include platform/libcore:/OWNERS +android-libcore-team+review@google.com diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg deleted file mode 100644 index 321bab6..0000000 --- a/PREUPLOAD.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[Builtin Hooks] -bpfmt = true diff --git a/android/src/main/java/com/squareup/okhttp/TEST_MAPPING b/android/src/main/java/com/squareup/okhttp/TEST_MAPPING deleted file mode 100644 index b2cf623..0000000 --- a/android/src/main/java/com/squareup/okhttp/TEST_MAPPING +++ /dev/null @@ -1,12 +0,0 @@ -{ - "presubmit": [ - { - "name": "CtsLibcoreOkHttpTestCases", - "options": [ - { - "include-filter": "com.squareup.okhttp" - } - ] - } - ] -}
\ No newline at end of file diff --git a/android/src/main/java/com/squareup/okhttp/internal/TEST_MAPPING b/android/src/main/java/com/squareup/okhttp/internal/TEST_MAPPING deleted file mode 100644 index a4da23b..0000000 --- a/android/src/main/java/com/squareup/okhttp/internal/TEST_MAPPING +++ /dev/null @@ -1,12 +0,0 @@ -{ - "presubmit": [ - { - "name": "CtsLibcoreOkHttpTestCases", - "options": [ - { - "include-filter": "com.squareup.okhttp.internal" - } - ] - } - ] -}
\ No newline at end of file diff --git a/mockwebserver/src/main/java/com/squareup/okhttp/mockwebserver/MockWebServer.java b/mockwebserver/src/main/java/com/squareup/okhttp/mockwebserver/MockWebServer.java index b15e92f..2c76398 100644 --- a/mockwebserver/src/main/java/com/squareup/okhttp/mockwebserver/MockWebServer.java +++ b/mockwebserver/src/main/java/com/squareup/okhttp/mockwebserver/MockWebServer.java @@ -551,7 +551,6 @@ public final class MockWebServer implements TestRule { + " and responded: " + response); } - // See warnings associated with these socket policies in SocketPolicy. if (response.getSocketPolicy() == SocketPolicy.DISCONNECT_AT_END) { socket.close(); return false; diff --git a/mockwebserver/src/main/java/com/squareup/okhttp/mockwebserver/SocketPolicy.java b/mockwebserver/src/main/java/com/squareup/okhttp/mockwebserver/SocketPolicy.java index cdbbf72..f71f33d 100644 --- a/mockwebserver/src/main/java/com/squareup/okhttp/mockwebserver/SocketPolicy.java +++ b/mockwebserver/src/main/java/com/squareup/okhttp/mockwebserver/SocketPolicy.java @@ -16,19 +16,7 @@ package com.squareup.okhttp.mockwebserver; -/** - * What should be done with the incoming socket. - * - * <p>Be careful when using values like {@link #DISCONNECT_AT_END}, {@link #SHUTDOWN_INPUT_AT_END} - * and {@link #SHUTDOWN_OUTPUT_AT_END} that close a socket after a response, and where there are - * follow-up requests. The client is unblocked and free to continue as soon as it has received the - * entire response body. If and when the client makes a subsequent request using a pooled socket the - * server may not have had time to close the socket. The socket will be closed at an indeterminate - * point before or during the second request. It may be closed after client has started sending the - * request body. If a request body is not retryable then the client may fail the request, making - * client behavior non-deterministic. Add delays in the client to improve the chances that the - * server has closed the socket before follow up requests are made. - */ +/** What should be done with the incoming socket. */ public enum SocketPolicy { /** @@ -40,8 +28,6 @@ public enum SocketPolicy { /** * Close the socket after the response. This is the default HTTP/1.0 * behavior. - * - * <p>See {@link SocketPolicy} for reasons why this can cause test flakiness and how to avoid it. */ DISCONNECT_AT_END, @@ -76,16 +62,12 @@ public enum SocketPolicy { /** * Shutdown the socket input after sending the response. For testing bad * behavior. - * - * <p>See {@link SocketPolicy} for reasons why this can cause test flakiness and how to avoid it. */ SHUTDOWN_INPUT_AT_END, /** * Shutdown the socket output after sending the response. For testing bad * behavior. - * - * <p>See {@link SocketPolicy} for reasons why this can cause test flakiness and how to avoid it. */ SHUTDOWN_OUTPUT_AT_END, diff --git a/okhttp-android-support/src/main/java/com/squareup/okhttp/TEST_MAPPING b/okhttp-android-support/src/main/java/com/squareup/okhttp/TEST_MAPPING deleted file mode 100644 index 6cbd1a2..0000000 --- a/okhttp-android-support/src/main/java/com/squareup/okhttp/TEST_MAPPING +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": [ - { - "path": "external/okhttp/android/src/main/java/com/squareup/okhttp" - } - ] -}
\ No newline at end of file diff --git a/okhttp-android-support/src/main/java/com/squareup/okhttp/internal/huc/TEST_MAPPING b/okhttp-android-support/src/main/java/com/squareup/okhttp/internal/huc/TEST_MAPPING deleted file mode 100644 index 452688a..0000000 --- a/okhttp-android-support/src/main/java/com/squareup/okhttp/internal/huc/TEST_MAPPING +++ /dev/null @@ -1,12 +0,0 @@ -{ - "presubmit": [ - { - "name": "CtsLibcoreOkHttpTestCases", - "options": [ - { - "include-filter": "com.squareup.okhttp.internal.huc" - } - ] - } - ] -}
\ No newline at end of file diff --git a/okhttp-tests/src/test/java/com/squareup/okhttp/URLConnectionTest.java b/okhttp-tests/src/test/java/com/squareup/okhttp/URLConnectionTest.java index a3e1450..8744c22 100644 --- a/okhttp-tests/src/test/java/com/squareup/okhttp/URLConnectionTest.java +++ b/okhttp-tests/src/test/java/com/squareup/okhttp/URLConnectionTest.java @@ -419,11 +419,6 @@ public final class URLConnectionTest { connection1.setReadTimeout(100); assertContent("This connection won't pool properly", connection1); assertEquals(0, server.takeRequest().getSequenceNumber()); - - // Give the server time to enact the socket policy if it's one that could happen after the - // client has received the response. - Thread.sleep(500); - HttpURLConnection connection2 = client.open(server.getUrl("/b")); connection2.setReadTimeout(100); assertContent("This comes after a busted connection", connection2); @@ -651,10 +646,6 @@ public final class URLConnectionTest { client.client().setHostnameVerifier(new RecordingHostnameVerifier()); assertContent("abc", client.open(server.getUrl("/"))); - - // Give the server time to disconnect. - Thread.sleep(500); - assertContent("def", client.open(server.getUrl("/"))); Set<TlsVersion> tlsVersions = @@ -1283,9 +1274,6 @@ public final class URLConnectionTest { // Seed the pool with a bad connection. assertContent("a", client.open(server.getUrl("/"))); - // Give the server time to disconnect. - Thread.sleep(500); - // This connection will need to be recovered. When it is, transparent gzip should still work! assertContent("b", client.open(server.getUrl("/"))); @@ -2680,9 +2668,6 @@ public final class URLConnectionTest { assertContent("A", client.open(server.getUrl("/a"))); - // Give the server time to disconnect. - Thread.sleep(500); - // If the request body is larger than OkHttp's replay buffer, the failure may still occur. byte[] requestBody = new byte[requestSize]; new Random(0).nextBytes(requestBody); diff --git a/okhttp-urlconnection/src/main/java/com/squareup/okhttp/TEST_MAPPING b/okhttp-urlconnection/src/main/java/com/squareup/okhttp/TEST_MAPPING deleted file mode 100644 index 6cbd1a2..0000000 --- a/okhttp-urlconnection/src/main/java/com/squareup/okhttp/TEST_MAPPING +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": [ - { - "path": "external/okhttp/android/src/main/java/com/squareup/okhttp" - } - ] -}
\ No newline at end of file diff --git a/okhttp-urlconnection/src/main/java/com/squareup/okhttp/internal/TEST_MAPPING b/okhttp-urlconnection/src/main/java/com/squareup/okhttp/internal/TEST_MAPPING deleted file mode 100644 index cb2ecc7..0000000 --- a/okhttp-urlconnection/src/main/java/com/squareup/okhttp/internal/TEST_MAPPING +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": [ - { - "path": "external/okhttp/android/src/main/java/com/squareup/okhttp/internal" - } - ] -}
\ No newline at end of file diff --git a/okhttp-urlconnection/src/main/java/com/squareup/okhttp/internal/huc/TEST_MAPPING b/okhttp-urlconnection/src/main/java/com/squareup/okhttp/internal/huc/TEST_MAPPING deleted file mode 100644 index 7137155..0000000 --- a/okhttp-urlconnection/src/main/java/com/squareup/okhttp/internal/huc/TEST_MAPPING +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": [ - { - "path": "external/okhttp/okhttp-android-support/src/main/java/com/squareup/okhttp/internal/huc" - } - ] -}
\ No newline at end of file diff --git a/okhttp/src/main/java/com/squareup/okhttp/TEST_MAPPING b/okhttp/src/main/java/com/squareup/okhttp/TEST_MAPPING deleted file mode 100644 index 6cbd1a2..0000000 --- a/okhttp/src/main/java/com/squareup/okhttp/TEST_MAPPING +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": [ - { - "path": "external/okhttp/android/src/main/java/com/squareup/okhttp" - } - ] -}
\ No newline at end of file diff --git a/okhttp/src/main/java/com/squareup/okhttp/internal/TEST_MAPPING b/okhttp/src/main/java/com/squareup/okhttp/internal/TEST_MAPPING deleted file mode 100644 index cb2ecc7..0000000 --- a/okhttp/src/main/java/com/squareup/okhttp/internal/TEST_MAPPING +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": [ - { - "path": "external/okhttp/android/src/main/java/com/squareup/okhttp/internal" - } - ] -}
\ No newline at end of file diff --git a/okhttp/src/main/java/com/squareup/okhttp/internal/framed/TEST_MAPPING b/okhttp/src/main/java/com/squareup/okhttp/internal/framed/TEST_MAPPING deleted file mode 100644 index 2ae9001..0000000 --- a/okhttp/src/main/java/com/squareup/okhttp/internal/framed/TEST_MAPPING +++ /dev/null @@ -1,12 +0,0 @@ -{ - "presubmit": [ - { - "name": "CtsLibcoreOkHttpTestCases", - "options": [ - { - "include-filter": "com.squareup.okhttp.internal.framed" - } - ] - } - ] -}
\ No newline at end of file diff --git a/okhttp/src/main/java/com/squareup/okhttp/internal/http/TEST_MAPPING b/okhttp/src/main/java/com/squareup/okhttp/internal/http/TEST_MAPPING deleted file mode 100644 index 79e9079..0000000 --- a/okhttp/src/main/java/com/squareup/okhttp/internal/http/TEST_MAPPING +++ /dev/null @@ -1,12 +0,0 @@ -{ - "presubmit": [ - { - "name": "CtsLibcoreOkHttpTestCases", - "options": [ - { - "include-filter": "com.squareup.okhttp.internal.http" - } - ] - } - ] -}
\ No newline at end of file diff --git a/okhttp/src/main/java/com/squareup/okhttp/internal/tls/TEST_MAPPING b/okhttp/src/main/java/com/squareup/okhttp/internal/tls/TEST_MAPPING deleted file mode 100644 index 8c9cdac..0000000 --- a/okhttp/src/main/java/com/squareup/okhttp/internal/tls/TEST_MAPPING +++ /dev/null @@ -1,12 +0,0 @@ -{ - "presubmit": [ - { - "name": "CtsLibcoreOkHttpTestCases", - "options": [ - { - "include-filter": "com.squareup.okhttp.internal.tls" - } - ] - } - ] -}
\ No newline at end of file diff --git a/okio/okio/src/main/java/okio/TEST_MAPPING b/okio/okio/src/main/java/okio/TEST_MAPPING deleted file mode 100644 index c2f1b40..0000000 --- a/okio/okio/src/main/java/okio/TEST_MAPPING +++ /dev/null @@ -1,12 +0,0 @@ -{ - "presubmit": [ - { - "name": "CtsLibcoreOkHttpTestCases", - "options": [ - { - "include-filter": "okio" - } - ] - } - ] -}
\ No newline at end of file |
