Merge "Adds a test case for WebAddress where the path component does not have a leading slash"

This commit is contained in:
Steve Block
2010-09-07 10:59:18 -07:00
committed by Android (Google) Code Review
2 changed files with 10 additions and 0 deletions

View File

@@ -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");

View File

@@ -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);
}
}