diff options
-rw-r--r-- | luni/src/test/java/libcore/java/net/URLTest.java | 11 |
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()); } } |