summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2016-08-10 15:17:26 +0100
committerNeil Fuller <nfuller@google.com>2016-10-05 11:59:15 +0100
commitf14b48abd257bddff050624b51a73440689fc22f (patch)
tree56b78f2a2e5459293e867f671a579c3eb67ef70e
parent57c2d5a042af3895fc1b232175d3103672a70aa4 (diff)
Modify tests to reflect different URL encoding for single quote
Single quotes in query parameters in HttpURLConnection changed behavior between M and N due to upstream changes in OkHttp: in N, single quotes started being encoded as %27 when present in query parameters. Unfortunately, this broke several "iTunes remote" apps: iTunes appears not to support %27 encoding for single quotes in its DAAP server. Bug: 30405333 Test: (old) cts test packages android.core.tests.libcore.package.okhttp and android.core.tests.libcore.package.libcore (cherry picked from commit 272317c3807fd40b04353354b540a6e2719e93a8) Change-Id: I3d19dd880202bdc8e5909482e0e6c5167024d410
-rw-r--r--luni/src/test/java/libcore/java/net/URLConnectionTest.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/luni/src/test/java/libcore/java/net/URLConnectionTest.java b/luni/src/test/java/libcore/java/net/URLConnectionTest.java
index 3f750e44c6..9ba2e071fd 100644
--- a/luni/src/test/java/libcore/java/net/URLConnectionTest.java
+++ b/luni/src/test/java/libcore/java/net/URLConnectionTest.java
@@ -2293,8 +2293,13 @@ public final class URLConnectionTest extends TestCase {
testUrlToRequestMapping("$", "$", "$");
testUrlToUriMapping("&", "&", "&", "&", "&");
testUrlToRequestMapping("&", "&", "&");
- testUrlToUriMapping("'", "'", "'", "%27", "'");
- testUrlToRequestMapping("'", "'", "%27");
+
+ // http://b/30405333 - upstream OkHttp encodes single quote (') as %27 in query parameters
+ // but this breaks iTunes remote apps: iTunes currently does not accept %27 so we have a
+ // local patch to retain the historic Android behavior of not encoding single quote.
+ testUrlToUriMapping("'", "'", "'", "'", "'");
+ testUrlToRequestMapping("'", "'", "'");
+
testUrlToUriMapping("(", "(", "(", "(", "(");
testUrlToRequestMapping("(", "(", "(");
testUrlToUriMapping(")", ")", ")", ")", ")");