tests/ceftests/parser_unittest.cc
// Parse a non-standard scheme.
Parse a non-standard scheme.
Parse a non - standard scheme .
TEST(ParserTest, ParseURLNonStandard) {
  CefURLParts parts;
  CefString url;
  url.FromASCII("custom:something%20else?foo#ref");
  EXPECT_TRUE(CefParseURL(url, parts));
  CefString spec(&parts.spec);
  EXPECT_STREQ("custom:something%20else?foo#ref", spec.ToString().c_str());
  EXPECT_EQ(0U, parts.username.length);
  EXPECT_EQ(0U, parts.password.length);
  CefString scheme(&parts.scheme);
  EXPECT_STREQ("custom", scheme.ToString().c_str());
  EXPECT_EQ(0U, parts.host.length);
  EXPECT_EQ(0U, parts.port.length);
  EXPECT_EQ(0U, parts.origin.length);
  CefString path(&parts.path);
  EXPECT_STREQ("something%20else", path.ToString().c_str());
  CefString query(&parts.query);
  EXPECT_STREQ("foo", query.ToString().c_str());
  CefString ref(&parts.fragment);
  EXPECT_STREQ("ref", ref.ToString().c_str());
}
TEST ( ParserTest , ParseURLNonStandard ) { CefURLParts parts ; CefString url ; url . FromASCII ( " " ) ; EXPECT_TRUE ( CefParseURL ( url , parts ) ) ; CefString spec ( & parts . spec ) ; EXPECT_STREQ ( " " , spec . ToString ( ) . c_str ( ) ) ; EXPECT_EQ ( 0U , parts . username . length ) ; EXPECT_EQ ( 0U , parts . password . length ) ; CefString scheme ( & parts . scheme ) ; EXPECT_STREQ ( " " , scheme . ToString ( ) . c_str ( ) ) ; EXPECT_EQ ( 0U , parts . host . length ) ; EXPECT_EQ ( 0U , parts . port . length ) ; EXPECT_EQ ( 0U , parts . origin . length ) ; 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 a non-standard scheme.
Parse a non - standard scheme .