tests/ceftests/parser_unittest.cc
// Parse the URL using all the various components.
Parse the URL using all the various components.
Parse the URL using all the various components .
TEST(ParserTest, ParseURLAll) {
  CefURLParts parts;
  CefString url;
  url.FromASCII(
      "http://user:pass@www.example.com:88/path/"
      "to.html?foo=test&bar=test2#ref");
  EXPECT_TRUE(CefParseURL(url, parts));
  CefString spec(&parts.spec);
  EXPECT_STREQ(
      "http://user:pass@www.example.com:88/path/to.html?foo=test&bar=test2#ref",
      spec.ToString().c_str());
  CefString scheme(&parts.scheme);
  EXPECT_STREQ("http", scheme.ToString().c_str());
  CefString username(&parts.username);
  EXPECT_STREQ("user", username.ToString().c_str());
  CefString password(&parts.password);
  EXPECT_STREQ("pass", password.ToString().c_str());
  CefString host(&parts.host);
  EXPECT_STREQ("www.example.com", host.ToString().c_str());
  CefString port(&parts.port);
  EXPECT_STREQ("88", port.ToString().c_str());
  CefString origin(&parts.origin);
  EXPECT_STREQ(origin.ToString().c_str(), "http://www.example.com:88/");
  CefString path(&parts.path);
  EXPECT_STREQ("/path/to.html", path.ToString().c_str());
  CefString query(&parts.query);
  EXPECT_STREQ("foo=test&bar=test2", query.ToString().c_str());
  CefString ref(&parts.fragment);
  EXPECT_STREQ("ref", ref.ToString().c_str());
}
TEST ( ParserTest , ParseURLAll ) { CefURLParts parts ; CefString url ; url . FromASCII ( " " " " ) ; EXPECT_TRUE ( CefParseURL ( url , parts ) ) ; CefString spec ( & parts . spec ) ; EXPECT_STREQ ( " " , spec . ToString ( ) . c_str ( ) ) ; CefString scheme ( & parts . scheme ) ; EXPECT_STREQ ( " " , scheme . ToString ( ) . c_str ( ) ) ; CefString username ( & parts . username ) ; EXPECT_STREQ ( " " , username . ToString ( ) . c_str ( ) ) ; CefString password ( & parts . password ) ; EXPECT_STREQ ( " " , password . ToString ( ) . c_str ( ) ) ; CefString host ( & parts . host ) ; EXPECT_STREQ ( " " , host . ToString ( ) . c_str ( ) ) ; CefString port ( & parts . port ) ; EXPECT_STREQ ( " " , port . ToString ( ) . c_str ( ) ) ; CefString origin ( & parts . origin ) ; EXPECT_STREQ ( origin . ToString ( ) . c_str ( ) , " " ) ; CefString path ( & parts . path ) ; EXPECT_STREQ ( " " , path . ToString ( ) . c_str ( ) ) ; CefString query ( & parts . query ) ; EXPECT_STREQ ( " " , query . ToString ( ) . c_str ( ) ) ; CefString ref ( & parts . fragment ) ; EXPECT_STREQ ( " " , ref . ToString ( ) . c_str ( ) ) ; }
Parse the URL using all the various components.
Parse the URL using all the various components .