Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 85a033af authored by Steve Block's avatar Steve Block Committed by Android (Google) Code Review
Browse files

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

parents c99b2b85 8bb37f7f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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");
+9 −0
Original line number Diff line number Diff line
@@ -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);
    }
}