summaryrefslogtreecommitdiffstats
path: root/core/tests
diff options
context:
space:
mode:
authorJesse Wilson <jessewilson@google.com>2010-12-01 11:48:51 -0800
committerJesse Wilson <jessewilson@google.com>2010-12-01 11:48:51 -0800
commit47413708eb42753d891882f488c2d6399b298169 (patch)
tree59a773770eb618bef31a5b8b4dbfbd009f820177 /core/tests
parentfff4ab09b6c69e437537f322aaca7829f009ff1d (diff)
downloadframeworks_base-47413708eb42753d891882f488c2d6399b298169.zip
frameworks_base-47413708eb42753d891882f488c2d6399b298169.tar.gz
frameworks_base-47413708eb42753d891882f488c2d6399b298169.tar.bz2
Add a test to demonstrate parsing of trailing URI parameters.
Change-Id: I1fde21381cf74b5e4847bb2c2a9ef52f8ac6a2bb http://b/3124097
Diffstat (limited to 'core/tests')
-rw-r--r--core/tests/coretests/src/android/net/UriTest.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/tests/coretests/src/android/net/UriTest.java b/core/tests/coretests/src/android/net/UriTest.java
index c8ad60d..b878aa5 100644
--- a/core/tests/coretests/src/android/net/UriTest.java
+++ b/core/tests/coretests/src/android/net/UriTest.java
@@ -732,4 +732,20 @@ public class UriTest extends TestCase {
assertEquals(1, names.size());
assertEquals("foo", names.iterator().next());
}
+
+ /**
+ * Query parameters may omit the '='. http://b/3124097
+ */
+ public void testGetQueryParametersEmptyValue() {
+ assertEquals(Arrays.asList(""),
+ Uri.parse("http://foo/path?abc").getQueryParameters("abc"));
+ assertEquals(Arrays.asList(""),
+ Uri.parse("http://foo/path?foo=bar&abc").getQueryParameters("abc"));
+ assertEquals(Arrays.asList(""),
+ Uri.parse("http://foo/path?abcd=abc&abc").getQueryParameters("abc"));
+ assertEquals(Arrays.asList("a", "", ""),
+ Uri.parse("http://foo/path?abc=a&abc=&abc").getQueryParameters("abc"));
+ assertEquals(Arrays.asList("a", "", ""),
+ Uri.parse("http://foo/path?abc=a&abc=&abc=").getQueryParameters("abc"));
+ }
}