Home | History | Annotate | Download | only in src

Lines Matching refs:url

34 // Returns the canonicalized string for the given URL string for the
51 // In the reverse, known schemes should always trigger standard URL handling.
70 GURL url(WStringToUTF16(L"http://user:pass@google.com:99/foo;bar?q=a#ref"));
71 EXPECT_TRUE(url.is_valid());
72 EXPECT_TRUE(url.SchemeIs("http"));
73 EXPECT_FALSE(url.SchemeIsFile());
75 // This is the narrow version of the URL, which should match the wide input.
76 EXPECT_EQ("http://user:pass@google.com:99/foo;bar?q=a#ref", url.spec());
78 EXPECT_EQ("http", url.scheme());
79 EXPECT_EQ("user", url.username());
80 EXPECT_EQ("pass", url.password());
81 EXPECT_EQ("google.com", url.host());
82 EXPECT_EQ("99", url.port());
83 EXPECT_EQ(99, url.IntPort());
84 EXPECT_EQ("/foo;bar", url.path());
85 EXPECT_EQ("q=a", url.query());
86 EXPECT_EQ("ref", url.ref());
90 GURL url;
91 EXPECT_FALSE(url.is_valid());
92 EXPECT_EQ("", url.spec());
94 EXPECT_EQ("", url.scheme());
95 EXPECT_EQ("", url.username());
96 EXPECT_EQ("", url.password());
97 EXPECT_EQ("", url.host());
98 EXPECT_EQ("", url.port());
99 EXPECT_EQ(url_parse::PORT_UNSPECIFIED, url.IntPort());
100 EXPECT_EQ("", url.path());
101 EXPECT_EQ("", url.query());
102 EXPECT_EQ("", url.ref());
106 GURL url(WStringToUTF16(L"http://user:pass@google.com:99/foo;bar?q=a#ref"));
108 GURL url2(url);
122 // Copying of invalid URL should be invalid
138 // Given an invalid URL, we should still get most of the components.
140 GURL url("http:google.com:foo");
141 EXPECT_FALSE(url.is_valid());
142 EXPECT_EQ("http://google.com:foo/", url.possibly_invalid_spec());
144 EXPECT_EQ("http", url.scheme());
145 EXPECT_EQ("", url.username());
146 EXPECT_EQ("", url.password());
147 EXPECT_EQ("google.com", url.host());
148 EXPECT_EQ("foo", url.port());
149 EXPECT_EQ(url_parse::PORT_INVALID, url.IntPort());
150 EXPECT_EQ("/", url.path());
151 EXPECT_EQ("", url.query());
152 EXPECT_EQ("", url.ref());
156 // The tricky cases for relative URL resolving are tested in the
205 GURL url(cases[i].input);
206 GURL origin = url.GetOrigin();
222 GURL url(cases[i].input);
223 GURL empty_path = url.GetWithEmptyPath();
229 // The url canonicalizer replacement test will handle most of these case.
254 GURL url(cur.base);
264 GURL output = url.ReplaceComponents(repl);
283 GURL url(cases[i].input);
284 std::string path_request = url.PathForRequest();
324 GURL url(port_tests[i].spec);
325 EXPECT_EQ(port_tests[i].expected_int_port, url.EffectiveIntPort());
345 GURL url(ip_tests[i].spec);
346 EXPECT_EQ(ip_tests[i].expected_ip, url.HostIsIPAddress());
360 // Don't require a valid URL, but don't crash either.
370 GURL url(cases[i].input);
371 EXPECT_EQ(cases[i].expected_host, url.host());
372 EXPECT_EQ(cases[i].expected_plainhost, url.HostNoBrackets());