merge in nougat-cts-release history after reset to nougat-cts-dev
diff --git a/luni/src/test/java/libcore/java/net/URLTest.java b/luni/src/test/java/libcore/java/net/URLTest.java
index 789e3e9..8ba1460 100644
--- a/luni/src/test/java/libcore/java/net/URLTest.java
+++ b/luni/src/test/java/libcore/java/net/URLTest.java
@@ -194,14 +194,6 @@
assertEquals(null, url.getRef());
}
- public void testAtSignInUserInfo() throws Exception {
- try {
- new URL("http://user@userhost.com:password@host");
- fail();
- } catch (MalformedURLException expected) {
- }
- }
-
public void testUserNoPassword() throws Exception {
URL url = new URL("http://user@host");
assertEquals("user@host", url.getAuthority());
@@ -757,4 +749,12 @@
assertEquals("/some/path", new URL("http://foobar.com/some/path#").getFile());
assertEquals("/some/path", new URL("http://foobar.com/some/path?#").getFile());
}
+
+ // http://b/33351987
+ public void testMultipleUserField() throws Exception {
+ final String host = "http://multiple@users@url.com";
+ URL url = new URL(host);
+ assertNull(url.getUserInfo());
+ assertTrue(url.getHost().isEmpty());
+ }
}