Merge "Adds a test case for WebAddress where the path component does not have a leading slash"
This commit is contained in:
@@ -285,6 +285,7 @@ public class UriTest extends TestCase {
|
||||
assertEquals("d", uri.getQueryParameter("c"));
|
||||
}
|
||||
|
||||
// http://b/2337042
|
||||
@SmallTest
|
||||
public void testHostWithTrailingDot() {
|
||||
Uri uri = Uri.parse("http://google.com./b/c/g");
|
||||
|
||||
@@ -22,10 +22,19 @@ import junit.framework.TestCase;
|
||||
|
||||
public class WebAddressTest extends TestCase {
|
||||
|
||||
// http://b/2337042
|
||||
@SmallTest
|
||||
public void testHostWithTrailingDot() {
|
||||
WebAddress webAddress = new WebAddress("http://google.com./b/c/g");
|
||||
assertEquals("google.com.", webAddress.mHost);
|
||||
assertEquals("/b/c/g", webAddress.mPath);
|
||||
}
|
||||
|
||||
// http://b/1011602
|
||||
@SmallTest
|
||||
public void testPathWithoutLeadingSlash() {
|
||||
WebAddress webAddress = new WebAddress("http://www.myspace.com?si=1");
|
||||
assertEquals("www.myspace.com", webAddress.mHost);
|
||||
assertEquals("/?si=1", webAddress.mPath);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user