aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYi Kong <yikong@google.com>2017-02-14 06:17:04 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-02-14 06:17:04 +0000
commite0874054acea0e164c4464d3bb82302df50e8e5c (patch)
treed1890bb30f8b2cc4dfa0fd0f3f7697924407d117
parent51fb3c64416f90b77671935fdb058d99fc3ed3f1 (diff)
parentaba0708c7d7ad195f9b2cf4b9199904560488e1f (diff)
downloadlibcore-android-7.1.2_r15.tar.gz
am: aba0708c7d Change-Id: Ibd29c496b3b1faadf53ad8349f59b22b08c105c6
-rw-r--r--luni/src/test/java/libcore/java/net/URLTest.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/luni/src/test/java/libcore/java/net/URLTest.java b/luni/src/test/java/libcore/java/net/URLTest.java
index 7a323af58e1..0eee1f8d9b0 100644
--- a/luni/src/test/java/libcore/java/net/URLTest.java
+++ b/luni/src/test/java/libcore/java/net/URLTest.java
@@ -194,12 +194,12 @@ public final class URLTest extends TestCase {
assertEquals(null, url.getRef());
}
+ // This behavior of URLs with invalid user info changed due to bug http://b/33351987 after
+ // Android security level 1 April 2017.
public void testAtSignInUserInfo() throws Exception {
- try {
- new URL("http://user@userhost.com:password@host");
- fail();
- } catch (MalformedURLException expected) {
- }
+ URL url = new URL("http://user@userhost.com:password@host");
+ assertNull(url.getUserInfo());
+ assertTrue(url.getHost().isEmpty());
}
public void testUserNoPassword() throws Exception {
@@ -785,5 +785,6 @@ public final class URLTest extends TestCase {
final String host = "http://multiple@users@url.com";
URL url = new URL(host);
assertNull(url.getUserInfo());
+ assertTrue(url.getHost().isEmpty());
}
}