tests/ceftests/cookie_unittest.cc
// Retrieve the test cookie. If |withDomain| is true check that the cookie
// is a domain cookie, otherwise a host cookie. if |deleteCookies| is true
// the cookie will be deleted when it's retrieved.
Retrieve the test cookie. If |withDomain| is true check that the cookie
is a domain cookie, otherwise a host cookie. if |deleteCookies| is true
the cookie will be deleted when it's retrieved.
Retrieve the test cookie . If |withDomain| is true check that the cookie is a domain cookie otherwise a host cookie . if |deleteCookies| is true the cookie will be deleted when it ' s retrieved .
void GetCookie(CefRefPtr<CefCookieManager> manager,
               const CefCookie& cookie,
               bool withDomain,
               CefRefPtr<CefWaitableEvent> event,
               bool deleteCookies) {
  CookieVector cookies;
  VisitUrlCookies(manager, kTestUrl, false, cookies, deleteCookies, event);
  EXPECT_EQ(1U, cookies.size());
  if (cookies.size() != 1U)
    return;
  const CefCookie& cookie_read = cookies[0];
  EXPECT_EQ(CefString(&cookie_read.name), "my_cookie");
  EXPECT_EQ(CefString(&cookie_read.value), "My Value");
  if (withDomain)
    EXPECT_EQ(CefString(&cookie_read.domain), ".www.test.com");
  else
    EXPECT_EQ(CefString(&cookie_read.domain), kTestDomain);
  EXPECT_EQ(CefString(&cookie_read.path), kTestPath);
  EXPECT_EQ(cookie.has_expires, cookie_read.has_expires);
  EXPECT_EQ(cookie.expires.year, cookie_read.expires.year);
  EXPECT_EQ(cookie.expires.month, cookie_read.expires.month);
  EXPECT_EQ(cookie.expires.day_of_week, cookie_read.expires.day_of_week);
  EXPECT_EQ(cookie.expires.day_of_month, cookie_read.expires.day_of_month);
  EXPECT_EQ(cookie.expires.hour, cookie_read.expires.hour);
  EXPECT_EQ(cookie.expires.minute, cookie_read.expires.minute);
  EXPECT_EQ(cookie.expires.second, cookie_read.expires.second);
  EXPECT_EQ(cookie.expires.millisecond, cookie_read.expires.millisecond);
  EXPECT_EQ(cookie.same_site, cookie_read.same_site);
  EXPECT_EQ(cookie.priority, cookie_read.priority);
}
void GetCookie ( CefRefPtr < CefCookieManager > manager , const CefCookie & cookie , bool withDomain , CefRefPtr < CefWaitableEvent > event , bool deleteCookies ) { CookieVector cookies ; VisitUrlCookies ( manager , kTestUrl , false , cookies , deleteCookies , event ) ; EXPECT_EQ ( 1U , cookies . size ( ) ) ; if ( cookies . size ( ) != 1U ) return ; const CefCookie & cookie_read = cookies [ 0 ] ; EXPECT_EQ ( CefString ( & cookie_read . name ) , " " ) ; EXPECT_EQ ( CefString ( & cookie_read . value ) , " " ) ; if ( withDomain ) EXPECT_EQ ( CefString ( & cookie_read . domain ) , " " ) ; else EXPECT_EQ ( CefString ( & cookie_read . domain ) , kTestDomain ) ; EXPECT_EQ ( CefString ( & cookie_read . path ) , kTestPath ) ; EXPECT_EQ ( cookie . has_expires , cookie_read . has_expires ) ; EXPECT_EQ ( cookie . expires . year , cookie_read . expires . year ) ; EXPECT_EQ ( cookie . expires . month , cookie_read . expires . month ) ; EXPECT_EQ ( cookie . expires . day_of_week , cookie_read . expires . day_of_week ) ; EXPECT_EQ ( cookie . expires . day_of_month , cookie_read . expires . day_of_month ) ; EXPECT_EQ ( cookie . expires . hour , cookie_read . expires . hour ) ; EXPECT_EQ ( cookie . expires . minute , cookie_read . expires . minute ) ; EXPECT_EQ ( cookie . expires . second , cookie_read . expires . second ) ; EXPECT_EQ ( cookie . expires . millisecond , cookie_read . expires . millisecond ) ; EXPECT_EQ ( cookie . same_site , cookie_read . same_site ) ; EXPECT_EQ ( cookie . priority , cookie_read . priority ) ; }
Retrieve the test cookie.
Retrieve the test cookie .
// Get the cookie and delete it.