Lines Matching defs:Component

33   Component expected_component;
44 Component expected_component;
54 Component expected_component;
100 void (Replacements<CHAR>::*set)(const CHAR*, const Component&),
107 (rep->*set)(str, Component(0, static_cast<int>(strlen(str))));
241 {"http", "http:", Component(0, 4), true},
242 {"HTTP", "http:", Component(0, 4), true},
243 {" HTTP ", "%20http%20:", Component(0, 10), false},
244 {"htt: ", "htt%3A%20:", Component(0, 9), false},
245 {"\xe4\xbd\xa0\xe5\xa5\xbdhttp", "%E4%BD%A0%E5%A5%BDhttp:", Component(0, 22), false},
248 {"ht%3Atp", "ht%3atp:", Component(0, 7), false},
255 Component in_comp(0, url_len);
256 Component out_comp;
287 Component out_comp;
291 EXPECT_TRUE(CanonicalizeScheme("", Component(0, -1), &output, &out_comp));
302 {"GoOgLe.CoM", L"GoOgLe.CoM", "google.com", Component(0, 10), CanonHostInfo::NEUTRAL, -1, ""},
304 {"Goo%20 goo%7C|.com", L"Goo%20 goo%7C|.com", "goo%20%20goo%7C%7C.com", Component(0, 22), CanonHostInfo::NEUTRAL, -1, ""},
306 {NULL, L"GOO\x00a0\x3000goo.com", "goo%20%20goo.com", Component(0, 16), CanonHostInfo::NEUTRAL, -1, ""},
309 {NULL, L"GOO\x200b\x2060\xfeffgoo.com", "googoo.com", Component(0, 10), CanonHostInfo::NEUTRAL, -1, ""},
312 {NULL, L"www.foo\x3002" L"bar.com", "www.foo.bar.com", Component(0, 15), CanonHostInfo::NEUTRAL, -1, ""},
317 {"\xef\xb7\x90zyx.com", L"\xfdd0zyx.com", "%EF%BF%BDzyx.com", Component(0, 16), CanonHostInfo::BROKEN, -1, ""},
319 {"%ef%b7%90zyx.com", L"%ef%b7%90zyx.com", "%EF%BF%BDzyx.com", Component(0, 16), CanonHostInfo::BROKEN, -1, ""},
322 {"\xef\xbc\xa7\xef\xbd\x8f.com", L"\xff27\xff4f.com", "go.com", Component(0, 6), CanonHostInfo::NEUTRAL, -1, ""},
326 {"\xef\xbc\x85\xef\xbc\x94\xef\xbc\x91.com", L"\xff05\xff14\xff11.com", "a.com", Component(0, 5), CanonHostInfo::NEUTRAL, -1, ""},
327 {"%ef%bc%85%ef%bc%94%ef%bc%91.com", L"%ef%bc%85%ef%bc%94%ef%bc%91.com", "a.com", Component(0, 5), CanonHostInfo::NEUTRAL, -1, ""},
329 {"\xef\xbc\x85\xef\xbc\x90\xef\xbc\x90.com", L"\xff05\xff10\xff10.com", "%00.com", Component(0, 7), CanonHostInfo::BROKEN, -1, ""},
330 {"%ef%bc%85%ef%bc%90%ef%bc%90.com", L"%ef%bc%85%ef%bc%90%ef%bc%90.com", "%00.com", Component(0, 7), CanonHostInfo::BROKEN, -1, ""},
332 {"\xe4\xbd\xa0\xe5\xa5\xbd\xe4\xbd\xa0\xe5\xa5\xbd", L"\x4f60\x597d\x4f60\x597d", "xn--6qqa088eba", Component(0, 14), CanonHostInfo::NEUTRAL, -1, ""},
343 Component(0, 11), CanonHostInfo::NEUTRAL, -1, ""},
347 "xn--wxaikc6b", Component(0, 12),
352 Component(0, 3), CanonHostInfo::NEUTRAL, -1, ""},
357 Component(0, 10), CanonHostInfo::NEUTRAL, -1, ""},
362 Component(0, 6), CanonHostInfo::NEUTRAL, -1, ""},
366 Component(0, 11), CanonHostInfo::BROKEN, -1, ""},
371 Component(0, 24), CanonHostInfo::BROKEN, -1, ""},
374 Component(0, 14), CanonHostInfo::NEUTRAL, -1, ""},
378 Component(0, 13), CanonHostInfo::NEUTRAL, -1, ""},
382 Component(0, 12), CanonHostInfo::NEUTRAL, -1, ""},
386 Component(0, 9), CanonHostInfo::BROKEN, -1, ""},
393 Component(0, 11), CanonHostInfo::NEUTRAL, -1, ""},
399 Component(0, 15), CanonHostInfo::NEUTRAL, -1, ""},
405 Component(0, 13), CanonHostInfo::NEUTRAL, -1, ""},
409 "%D8%AC%D8%A7%D8%B1xyz", Component(0, 21),
414 "xn--2-ymcov", Component(0, 11),
419 "%D8%AC%D8%A7%D8%B1xy2", Component(0, 21),
424 "xn--mgbjq0r", Component(0, 11),
430 "%D8%AC%D8%A7%D8%B1xy%D9%A2", Component(0, 26),
434 "%D8%AC%D8%A7%D8%B1xy2%D9%A2", Component(0, 27),
438 Component(0, 13), CanonHostInfo::BROKEN, -1, ""},
441 Component(0, 10), CanonHostInfo::BROKEN, -1, ""},
448 Component(0, 14), CanonHostInfo::NEUTRAL, -1, ""},
451 {"%zz%66%a", L"%zz%66%a", "%25zzf%25a", Component(0, 10),
454 {"%25", L"%25", "%25", Component(0, 3),
456 {"hello%00", L"hello%00", "hello%00", Component(0, 8),
460 "192.168.0.1", Component(0, 11), CanonHostInfo::IPV4, 3,
463 "192.168.0.1", Component(0, 11), CanonHostInfo::IPV4, 3,
466 {"%3g%78%63%30%2e%30%32%35%30%2E.01", L"%3g%78%63%30%2e%30%32%35%30%2E.01", "%253gxc0.0250..01", Component(0, 17), CanonHostInfo::BROKEN, -1, ""},
469 {"192.168.0.1 hello", L"192.168.0.1 hello", "192.168.0.1%20hello", Component(0, 19), CanonHostInfo::NEUTRAL, -1, ""},
472 {"\xef\xbc\x90%Ef%bc\xb8%ef%Bd%83\xef\xbc\x90%EF%BC%8E\xef\xbc\x90\xef\xbc\x92\xef\xbc\x95\xef\xbc\x90\xef\xbc%8E\xef\xbc\x90\xef\xbc\x91", L"\xff10\xff38\xff43\xff10\xff0e\xff10\xff12\xff15\xff10\xff0e\xff10\xff11", "192.168.0.1", Component(0, 11), CanonHostInfo::IPV4, 3, "C0A80001"},
474 {"192.168.0.257", L"192.168.0.257", "192.168.0.257", Component(0, 13), CanonHostInfo::BROKEN, -1, ""},
475 {"[google.com]", L"[google.com]", "[google.com]", Component(0, 12), CanonHostInfo::BROKEN, -1, ""},
480 {"\xd1\x82(", L"\x0442(", "xn--%28-7ed", Component(0, 11),
485 {"12345678912345.de", L"12345678912345.de", "12345678912345.de", Component(0, 17), CanonHostInfo::NEUTRAL, -1, ""},
486 {"1.12345678912345.de", L"1.12345678912345.de", "1.12345678912345.de", Component(0, 19), CanonHostInfo::NEUTRAL, -1, ""},
487 {"12345678912345.12345678912345.de", L"12345678912345.12345678912345.de", "12345678912345.12345678912345.de", Component(0, 32), CanonHostInfo::NEUTRAL, -1, ""},
488 {"1.2.0xB3A73CE5B59.de", L"1.2.0xB3A73CE5B59.de", "1.2.0xb3a73ce5b59.de", Component(0, 20), CanonHostInfo::NEUTRAL, -1, ""},
489 {"12345678912345.0xde", L"12345678912345.0xde", "12345678912345.0xde", Component(0, 19), CanonHostInfo::BROKEN, -1, ""},
498 Component in_comp(0, host_len);
499 Component out_comp;
522 Component in_comp(0, host_len);
523 Component out_comp;
545 Component in_comp(0, host_len);
572 Component in_comp(0, host_len);
599 {"", L"", "", Component(), CanonHostInfo::NEUTRAL, -1, ""},
600 {".", L".", "", Component(), CanonHostInfo::NEUTRAL, -1, ""},
602 {"192.168.0.1", L"192.168.0.1", "192.168.0.1", Component(0, 11), CanonHostInfo::IPV4, 4, "C0A80001"},
603 {"0300.0250.00.01", L"0300.0250.00.01", "192.168.0.1", Component(0, 11), CanonHostInfo::IPV4, 4, "C0A80001"},
604 {"0xC0.0Xa8.0x0.0x1", L"0xC0.0Xa8.0x0.0x1", "192.168.0.1", Component(0, 11), CanonHostInfo::IPV4, 4, "C0A80001"},
606 {"192.168.9.com", L"192.168.9.com", "", Component(), CanonHostInfo::NEUTRAL, -1, ""},
608 {"19a.168.0.1", L"19a.168.0.1", "", Component(), CanonHostInfo::NEUTRAL, -1, ""},
609 {"0308.0250.00.01", L"0308.0250.00.01", "", Component(), CanonHostInfo::NEUTRAL, -1, ""},
610 {"0xCG.0xA8.0x0.0x1", L"0xCG.0xA8.0x0.0x1", "", Component(), CanonHostInfo::NEUTRAL, -1, ""},
612 {"192", L"192", "0.0.0.192", Component(0, 9), CanonHostInfo::IPV4, 1, "000000C0"},
613 {"0xC0a80001", L"0xC0a80001", "192.168.0.1", Component(0, 11), CanonHostInfo::IPV4, 1, "C0A80001"},
614 {"030052000001", L"030052000001", "192.168.0.1", Component(0, 11), CanonHostInfo::IPV4, 1, "C0A80001"},
615 {"000030052000001", L"000030052000001", "192.168.0.1", Component(0, 11), CanonHostInfo::IPV4, 1, "C0A80001"},
616 {"192.168", L"192.168", "192.0.0.168", Component(0, 11), CanonHostInfo::IPV4, 2, "C00000A8"},
617 {"192.0x00A80001", L"192.0x000A80001", "192.168.0.1", Component(0, 11), CanonHostInfo::IPV4, 2, "C0A80001"},
618 {"0xc0.052000001", L"0xc0.052000001", "192.168.0.1", Component(0, 11), CanonHostInfo::IPV4, 2, "C0A80001"},
619 {"192.168.1", L"192.168.1", "192.168.0.1", Component(0, 11), CanonHostInfo::IPV4, 3, "C0A80001"},
621 {"192.168.0.0.1", L"192.168.0.0.1", "", Component(), CanonHostInfo::NEUTRAL, -1, ""},
623 {"192.168.0.1.", L"192.168.0.1.", "192.168.0.1", Component(0, 11), CanonHostInfo::IPV4, 4, "C0A80001"},
624 {"192.168.0.1. hello", L"192.168.0.1. hello", "", Component(), CanonHostInfo::NEUTRAL, -1, ""},
625 {"192.168.0.1..", L"192.168.0.1..", "", Component(), CanonHostInfo::NEUTRAL, -1, ""},
627 {"192.168..1", L"192.168..1", "", Component(), CanonHostInfo::NEUTRAL, -1, ""},
629 {"0x100.0", L"0x100.0", "", Component(), CanonHostInfo::BROKEN, -1, ""},
630 {"0x100.0.0", L"0x100.0.0", "", Component(), CanonHostInfo::BROKEN, -1, ""},
631 {"0x100.0.0.0", L"0x100.0.0.0", "", Component(), CanonHostInfo::BROKEN, -1, ""},
632 {"0.0x100.0.0", L"0.0x100.0.0", "", Component(), CanonHostInfo::BROKEN, -1, ""},
633 {"0.0.0x100.0", L"0.0.0x100.0", "", Component(), CanonHostInfo::BROKEN, -1, ""},
634 {"0.0.0.0x100", L"0.0.0.0x100", "", Component(), CanonHostInfo::BROKEN, -1, ""},
635 {"0.0.0x10000", L"0.0.0x10000", "", Component(), CanonHostInfo::BROKEN, -1, ""},
636 {"0.0x1000000", L"0.0x1000000", "", Component(), CanonHostInfo::BROKEN, -1, ""},
637 {"0x100000000", L"0x100000000", "", Component(), CanonHostInfo::BROKEN, -1, ""},
639 {"0xFF.0", L"0xFF.0", "255.0.0.0", Component(0, 9), CanonHostInfo::IPV4, 2, "FF000000"},
640 {"0xFF.0.0", L"0xFF.0.0", "255.0.0.0", Component(0, 9), CanonHostInfo::IPV4, 3, "FF000000"},
641 {"0xFF.0.0.0", L"0xFF.0.0.0", "255.0.0.0", Component(0, 9), CanonHostInfo::IPV4, 4, "FF000000"},
642 {"0.0xFF.0.0", L"0.0xFF.0.0", "0.255.0.0", Component(0, 9), CanonHostInfo::IPV4, 4, "00FF0000"},
643 {"0.0.0xFF.0", L"0.0.0xFF.0", "0.0.255.0", Component(0, 9), CanonHostInfo::IPV4, 4, "0000FF00"},
644 {"0.0.0.0xFF", L"0.0.0.0xFF", "0.0.0.255", Component(0, 9), CanonHostInfo::IPV4, 4, "000000FF"},
645 {"0.0.0xFFFF", L"0.0.0xFFFF", "0.0.255.255", Component(0, 11), CanonHostInfo::IPV4, 3, "0000FFFF"},
646 {"0.0xFFFFFF", L"0.0xFFFFFF", "0.255.255.255", Component(0, 13), CanonHostInfo::IPV4, 2, "00FFFFFF"},
647 {"0xFFFFFFFF", L"0xFFFFFFFF", "255.255.255.255", Component(0, 15), CanonHostInfo::IPV4, 1, "FFFFFFFF"},
649 {"276.256.0xf1a2.077777", L"276.256.0xf1a2.077777", "", Component(), CanonHostInfo::BROKEN, -1, ""},
650 {"192.168.0.257", L"192.168.0.257", "", Component(), CanonHostInfo::BROKEN, -1, ""},
651 {"192.168.0xa20001", L"192.168.0xa20001", "", Component(), CanonHostInfo::BROKEN, -1, ""},
652 {"192.015052000001", L"192.015052000001", "", Component(), CanonHostInfo::BROKEN, -1, ""},
653 {"0X12C0a80001", L"0X12C0a80001", "", Component(), CanonHostInfo::BROKEN, -1, ""},
654 {"276.1.2", L"276.1.2", "", Component(), CanonHostInfo::BROKEN, -1, ""},
656 {"192.168.0.1 hello", L"192.168.0.1 hello", "", Component(), CanonHostInfo::NEUTRAL, -1, ""},
658 {"0000000000000300.0x00000000000000fF.00000000000000001", L"0000000000000300.0x00000000000000fF.00000000000000001", "192.255.0.1", Component(0, 11), CanonHostInfo::IPV4, 3, "C0FF0001"},
659 {"0000000000000300.0xffffffffFFFFFFFF.3022415481470977", L"0000000000000300.0xffffffffFFFFFFFF.3022415481470977", "", Component(0, 11), CanonHostInfo::BROKEN, -1, ""},
661 {"00000000000000000001", L"00000000000000000001", "0.0.0.1", Component(0, 7), CanonHostInfo::IPV4, 1, "00000001"},
662 {"0000000000000000100000000000000001", L"0000000000000000100000000000000001", "", Component(), CanonHostInfo::BROKEN, -1, ""},
664 {"0.0.0.000000000000000000z", L"0.0.0.000000000000000000z", "", Component(), CanonHostInfo::NEUTRAL, -1, ""},
665 {"0.0.0.100000000000000000z", L"0.0.0.100000000000000000z", "", Component(), CanonHostInfo::NEUTRAL, -1, ""},
667 {"0.00.0x.0x0", L"0.00.0x.0x0", "0.0.0.0", Component(0, 7), CanonHostInfo::IPV4, 4, "00000000"},
672 Component component(0, static_cast<int>(strlen(cases[i].input8)));
693 component = Component(0, static_cast<int>(input16.length()));
716 {"", L"", "", Component(), CanonHostInfo::NEUTRAL, -1, ""},
718 {":", L":", "", Component(), CanonHostInfo::BROKEN, -1, ""},
719 {"[", L"[", "", Component(), CanonHostInfo::BROKEN, -1, ""},
720 {"[:", L"[:", "", Component(), CanonHostInfo::BROKEN, -1, ""},
721 {"]", L"]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
722 {":]", L":]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
723 {"[]", L"[]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
724 {"[:]", L"[:]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
726 {"2001:db8::1", L"2001:db8::1", "", Component(), CanonHostInfo::BROKEN, -1, ""},
727 {"[2001:db8::1", L"[2001:db8::1", "", Component(), CanonHostInfo::BROKEN, -1, ""},
728 {"2001:db8::1]", L"2001:db8::1]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
730 {"[::]", L"[::]", "[::]", Component(0,4), CanonHostInfo::IPV6, -1, "00000000000000000000000000000000"},
731 {"[::1]", L"[::1]", "[::1]", Component(0,5), CanonHostInfo::IPV6, -1, "00000000000000000000000000000001"},
732 {"[1::]", L"[1::]", "[1::]", Component(0,5), CanonHostInfo::IPV6, -1, "00010000000000000000000000000000"},
735 {"[000:01:02:003:004:5:6:007]", L"[000:01:02:003:004:5:6:007]", "[0:1:2:3:4:5:6:7]", Component(0,17), CanonHostInfo::IPV6, -1, "00000001000200030004000500060007"},
738 {"[A:b:c:DE:fF:0:1:aC]", L"[A:b:c:DE:fF:0:1:aC]", "[a:b:c:de:ff:0:1:ac]", Component(0,20), CanonHostInfo::IPV6, -1, "000A000B000C00DE00FF0000000100AC"},
742 {"[1:0:0:2::3:0]", L"[1:0:0:2::3:0]", "[1::2:0:0:3:0]", Component(0,14), CanonHostInfo::IPV6, -1, "00010000000000020000000000030000"},
743 {"[1::2:0:0:3:0]", L"[1::2:0:0:3:0]", "[1::2:0:0:3:0]", Component(0,14), CanonHostInfo::IPV6, -1, "00010000000000020000000000030000"},
746 {"[::192.168.0.1]", L"[::192.168.0.1]", "[::c0a8:1]", Component(0,10), CanonHostInfo::IPV6, -1, "000000000000000000000000C0A80001"},
747 {"[::ffff:192.168.0.1]", L"[::ffff:192.168.0.1]", "[::ffff:c0a8:1]", Component(0,15), CanonHostInfo::IPV6, -1, "00000000000000000000FFFFC0A80001"},
748 {"[::eeee:192.168.0.1]", L"[::eeee:192.168.0.1]", "[::eeee:c0a8:1]", Component(0, 15), CanonHostInfo::IPV6, -1, "00000000000000000000EEEEC0A80001"},
749 {"[2001::192.168.0.1]", L"[2001::192.168.0.1]", "[2001::c0a8:1]", Component(0, 14), CanonHostInfo::IPV6, -1, "200100000000000000000000C0A80001"},
750 {"[1:2:192.168.0.1:5:6]", L"[1:2:192.168.0.1:5:6]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
753 {"[::ffff:192.1.2]", L"[::ffff:192.1.2]", "[::ffff:c001:2]", Component(0,15), CanonHostInfo::IPV6, -1, "00000000000000000000FFFFC0010002"},
757 {"[::ffff:0xC0.0Xa8.0x0.0x1]", L"[::ffff:0xC0.0Xa8.0x0.0x1]", "[::ffff:c0a8:1]", Component(0,15), CanonHostInfo::IPV6, -1, "00000000000000000000FFFFC0A80001"},
760 {"[0:0::0:0:8]", L"[0:0::0:0:8]", "[::8]", Component(0,5), CanonHostInfo::IPV6, -1, "00000000000000000000000000000008"},
762 {"[2001:db8::1]", L"[2001:db8::1]", "[2001:db8::1]", Component(0,13), CanonHostInfo::IPV6, -1, "20010DB8000000000000000000000001"},
765 {"[2001::db8::1]", L"[2001::db8::1]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
767 {"[2001:db8:::1]", L"[2001:db8:::1]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
768 {"[:::]", L"[:::]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
770 {"[2001::.com]", L"[2001::.com]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
774 {"[::192.168.0.0.1]", L"[::192.168.0.0.1]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
775 {"[::ffff:192.168.0.0.1]", L"[::ffff:192.168.0.0.1]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
776 {"[1:2:3:4:5:6:7:8:9]", L"[1:2:3:4:5:6:7:8:9]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
778 {"[0:0:0:0:0:0:0:192.168.0.1]", L"[0:0:0:0:0:0:0:192.168.0.1]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
782 {"[1:2:3:4:5:6::192.168.0.1]", L"[1:2:3:4:5:6::192.168.0.1]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
785 {"[1:2:3:4:5:6::8]", L"[1:2:3:4:5:6::8]", "[1:2:3:4:5:6:0:8]", Component(0,17), CanonHostInfo::IPV6, -1, "00010002000300040005000600000008"},
788 {"[1:2:3:4:5:6:7:8:]", L"[1:2:3:4:5:6:7:8:]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
789 {"[1:2:3:4:5:6:192.168.0.1:]", L"[1:2:3:4:5:6:192.168.0.1:]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
792 {"[-1:2:3:4:5:6:7:8]", L"[-1:2:3:4:5:6:7:8]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
801 {"[1::%1]", L"[1::%1]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
802 {"[1::%eth0]", L"[1::%eth0]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
803 {"[1::%]", L"[1::%]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
804 {"[%]", L"[%]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
805 {"[::%:]", L"[::%:]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
808 {"[:0:0::0:0:8]", L"[:0:0::0:0:8]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
809 {"[0:0::0:0:8:]", L"[0:0::0:0:8:]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
810 {"[:0:0::0:0:8:]", L"[:0:0::0:0:8:]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
815 {"[::192.168..1]", L"[::192.168..1]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
819 {"[::1 hello]", L"[::1 hello]", "", Component(), CanonHostInfo::BROKEN, -1, ""},
824 Component component(0, static_cast<int>(strlen(cases[i].input8)));
844 component = Component(0, static_cast<int>(input16.length()));
869 CanonicalizeIPAddress(spec, Component(), &output1, &host_info);
872 CanonicalizeIPAddress(spec, Component(0, 0), &output1, &host_info);
884 Component expected_username;
885 Component expected_password;
888 {"http://user:pass@host.com/", "user:pass@", Component(0, 4), Component(5, 4), true},
889 {"http://@host.com/", "", Component(0, -1), Component(0, -1), true},
890 {"http://:@host.com/", "", Component(0, -1), Component(0, -1), true},
891 {"http://foo:@host.com/", "foo@", Component(0, 3), Component(0, -1), true},
892 {"http://:foo@host.com/", ":foo@", Component(0, 0), Component(1, 3), true},
893 {"http://^ :$\t@host.com/", "%5E%20:$%09@", Component(0, 6), Component(7, 4), true},
894 {"http://user:pass@/", "user:pass@", Component(0, 4), Component(5, 4), true},
895 {"http://%2540:bar@domain.com/", "%2540:bar@", Component(0, 5), Component(6, 3), true },
899 {"ftp://me\\mydomain:pass@foo.com/", "", Component(0, -1), Component(0, -1), true},
906 Component out_user, out_pass;
958 Component expected_component;
962 {"as df", 80, ":as%20df", Component(1, 7), false},
963 {"-2", 80, ":-2", Component(1, 2), false},
965 {"80", 80, "", Component(0, -1), true},
966 {"8080", 80, ":8080", Component(1, 4), true},
968 {"80", PORT_UNSPECIFIED, ":80", Component(1, 2), true},
973 Component in_comp(0, url_len);
974 Component out_comp;
1010 {"/././foo", L"/././foo", "/foo", Component(0, 4), true},
1011 {"/./.foo", L"/./.foo", "/.foo", Component(0, 5), true},
1012 {"/foo/.", L"/foo/.", "/foo/", Component(0, 5), true},
1013 {"/foo/./", L"/foo/./", "/foo/", Component(0, 5), true},
1015 {"/foo/bar/..", L"/foo/bar/..", "/foo/", Component(0, 5), true},
1016 {"/foo/bar/../", L"/foo/bar/../", "/foo/", Component(0, 5), true},
1018 {"/foo/..bar", L"/foo/..bar", "/foo/..bar", Component(0, 10), true},
1020 {"/foo/bar/../ton", L"/foo/bar/../ton", "/foo/ton", Component(0, 8), true},
1021 {"/foo/bar/../ton/../../a", L"/foo/bar/../ton/../../a", "/a", Component(0, 2), true},
1023 {"/foo/../../..", L"/foo/../../..", "/", Component(0, 1), true},
1024 {"/foo/../../../ton", L"/foo/../../../ton", "/ton", Component(0, 4), true},
1026 {"/foo/%2e", L"/foo/%2e", "/foo/", Component(0, 5), true},
1027 {"/foo/%2e%2", L"/foo/%2e%2", "/foo/.%2", Component(0, 8), true},
1028 {"/foo/%2e./%2e%2e/.%2e/%2e.bar", L"/foo/%2e./%2e%2e/.%2e/%2e.bar", "/..bar", Component(0, 6), true},
1031 {"////../..", L"////../..", "//", Component(0, 2), true},
1034 {"/foo", L"/foo", "/foo", Component(0, 4), true},
1036 {"/%20foo", L"/%20foo", "/%20foo", Component(0, 7), true},
1038 {"/foo%", L"/foo%", "/foo%", Component(0, 5), true},
1039 {"/foo%2", L"/foo%2", "/foo%2", Component(0, 6), true},
1042 {"/foo%2zbar", L"/foo%2zbar", "/foo%2zbar", Component(0, 10), true},
1043 {"/foo%2\xc2\xa9zbar", NULL, "/foo%2%C2%A9zbar", Component(0, 16), true},
1044 {NULL, L"/foo%2\xc2\xa9zbar", "/foo%2%C3%82%C2%A9zbar", Component(0, 22), true},
1046 {"/foo%41%7a", L"/foo%41%7a", "/fooAz", Component(0, 6), true},
1048 {"/foo\x09\x91%91", NULL, "/foo%09%91%91", Component(0, 13), true},
1049 {NULL, L"/foo\x09\x91%91", "/foo%09%C2%91%91", Component(0, 16), true},
1051 {"/foo%00%51", L"/foo%00%51", "/foo%00Q", Component(0, 8), false},
1053 {"/(%28:%3A%29)", L"/(%28:%3A%29)", "/(%28:%3A%29)", Component(0, 13), true},
1056 {"/%3A%3a%3C%3c", L"/%3A%3a%3C%3c", "/%3A%3a%3C%3c", Component(0, 13), true},
1058 {"/foo\tbar", L"/foo\tbar", "/foo%09bar", Component(0, 10), true},
1060 {"\\foo\\bar", L"\\foo\\bar", "/foo/bar", Component(0, 8), true},
1063 {"/foo#bar", L"/foo#bar", "/foo%23bar", Component(0, 10), true},
1066 {"/%7Ffp3%3Eju%3Dduvgw%3Dd", L"/%7Ffp3%3Eju%3Dduvgw%3Dd", "/%7Ffp3%3Eju%3Dduvgw%3Dd", Component(0, 24), true},
1068 {"/@asdf%40", L"/@asdf%40", "/@asdf%40", Component(0, 9), true},
1072 {"/\xe4\xbd\xa0\xe5\xa5\xbd\xe4\xbd\xa0\xe5\xa5\xbd", L"/\x4f60\x597d\x4f60\x597d", "/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD", Component(0, 37), true},
1075 {"/\xef\xb7\x90zyx", NULL, "/%EF%B7%90zyx", Component(0, 13), true},
1076 {NULL, L"/\xfdd0zyx", "/%EF%BF%BDzyx", Component(0, 13), false},
1082 Component in_comp(0, len);
1083 Component out_comp;
1099 Component in_comp(0, len);
1100 Component out_comp;
1118 Component in_comp(0, 5);
1119 Component out_comp;
1156 Component out_comp;
1160 Component in_comp(0, len);
1174 Component in_comp(0, len);
1188 Component out_comp;
1189 CanonicalizeQuery("a \x00z\x01", Component(0, 5), NULL, &output, &out_comp);
1198 {"hello, world", L"hello, world", "#hello, world", Component(1, 12), true},
1200 {"\xc2\xa9", L"\xa9", "#\xc2\xa9", Component(1, 2), true},
1202 {"\xF0\x90\x8C\x80ss", L"\xd800\xdf00ss", "#\xF0\x90\x8C\x80ss", Component(1, 6), true},
1204 {"%41%a", L"%41%a", "#%41%a", Component(1, 5), true},
1206 {"\xc2", NULL, "#\xef\xbf\xbd", Component(1, 3), true},
1207 {NULL, L"\xd800\x597d", "#\xef\xbf\xbd\xe5\xa5\xbd", Component(1, 6), true},
1209 {"a\xef\xb7\x90", L"a\xfdd0", "#a\xef\xbf\xbd", Component(1, 4), true},
1211 {"asdf#qwer", L"asdf#qwer", "#asdf#qwer", Component(1, 9), true},
1212 {"#asdf", L"#asdf", "##asdf", Component(1, 5), true},
1219 Component in_comp(0, len);
1220 Component out_comp;
1236 Component in_comp(0, len);
1237 Component out_comp;
1252 Component null_input_component(0, 4);
1253 Component out_comp;
1385 r.SetPath(reinterpret_cast<char*>(0x00000001), Component(0, 0));
1394 r.SetPath(reinterpret_cast<char*>(0x00000001), Component());
1594 Component expected_host;
1595 Component expected_path;
1599 {"file:c:\\foo\\bar.html", "file:///C:/foo/bar.html", true, Component(), Component(7, 16)},
1600 {" File:c|////foo\\bar.html", "file:///C:////foo/bar.html", true, Component(), Component(7, 19)},
1601 {"file:", "file:///", true, Component(), Component(7, 1)},
1602 {"file:UNChost/path", "file://unchost/path", true, Component(7, 7), Component(14, 5)},
1607 {"c:\\foo\\bar", "file:///C:/foo/bar", true, Component(), Component(7, 11)},
1608 {"C|/foo/bar", "file:///C:/foo/bar", true, Component(), Component(7, 11)},
1609 {"/C|\\foo\\bar", "file:///C:/foo/bar", true, Component(), Component(7, 11)},
1610 {"//C|/foo/bar", "file:///C:/foo/bar", true, Component(), Component(7, 11)},
1611 {"//server/file", "file://server/file", true, Component(7, 6), Component(13, 5)},
1612 {"\\\\server\\file", "file://server/file", true, Component(7, 6), Component(13, 5)},
1613 {"/\\server/file", "file://server/file", true, Component(7, 6), Component(13, 5)},
1617 {"file:c:foo/bar.html", "file:///C:/foo/bar.html", true, Component(), Component(7, 16)},
1618 {"file:/\\/\\C:\\\\//foo\\bar.html", "file:///C:////foo/bar.html", true, Component(), Component(7, 19)},
1621 {"file:///foo/bar.txt", "file:///foo/bar.txt", true, Component(), Component(7, 12)},
1628 {"FILE:/\\/\\7:\\\\//foo\\bar.html", "file://7:////foo/bar.html", false, Component(7, 2), Component(9, 16)},
1629 {"file:filer/home\\me", "file://filer/home/me", true, Component(7, 5), Component(12, 8)},
1631 {"file:///C:/foo/../../../bar.html", "file:///C:/bar.html", true, Component(), Component(7, 12)},
1633 {"file:///C:/asdf#\xc2", "file:///C:/asdf#\xef\xbf\xbd", true, Component(), Component(7, 8)},
1636 {"file:///home/me", "file:///home/me", true, Component(), Component(7, 8)},
1638 {"file:c:\\foo\\bar.html", "file:///c:/foo/bar.html", true, Component(), Component(7, 16)},
1639 {"file:c|//foo\\bar.html", "file:///c%7C//foo/bar.html", true, Component(), Component(7, 19)},
1641 {"//", "file:///", true, Component(), Component(7, 1)},
1642 {"///", "file:///", true, Component(), Component(7, 1)},
1643 {"///test", "file:///test", true, Component(), Component(7, 5)},
1644 {"file://test", "file://test/", true, Component(7, 4), Component(11, 1)},
1645 {"file://localhost", "file://localhost/", true, Component(7, 9), Component(16, 1)},
1646 {"file://localhost/", "file://localhost/", true, Component(7, 9), Component(16, 1)},
1647 {"file://localhost/test", "file://localhost/test", true, Component(7, 9), Component(16, 5)},
1760 Component expected_path;
1761 Component expected_query;
1763 {"mailto:addr1", "mailto:addr1", true, Component(7, 5), Component()},
1764 {"mailto:addr1@foo.com", "mailto:addr1@foo.com", true, Component(7, 13), Component()},
1766 {"MaIlTo:addr1 \t ", "mailto:addr1", true, Component(7, 5), Component()},
1767 {"MaIlTo:addr1?to=jon", "mailto:addr1?to=jon", true, Component(7, 5), Component(13,6)},
1768 {"mailto:addr1,addr2", "mailto:addr1,addr2", true, Component(7, 11), Component()},
1769 {"mailto:addr1, addr2", "mailto:addr1, addr2", true, Component(7, 12), Component()},
1770 {"mailto:addr1%2caddr2", "mailto:addr1%2caddr2", true, Component(7, 13), Component()},
1771 {"mailto:\xF0\x90\x8C\x80", "mailto:%F0%90%8C%80", true, Component(7, 12), Component()},
1773 {"mailto:addr1\0addr2?foo", "mailto:addr1%00addr2?foo", true, Component(7, 13), Component(21, 3)},
1775 {"mailto:\xed\xa0\x80", "mailto:%EF%BF%BD", false, Component(7, 9), Component()},
1776 {"mailto:addr1?", "mailto:addr1?", true, Component(7, 5), Component(13, 0)},
2061 Component relative_component;
2118 repl.SetPath(new_path.c_str(), Component(0, 4));
2120 Component(0, static_cast<int>(new_query.length())));