tests/ceftests/cookie_unittest.cc
// Create a test cookie. If |withDomain| is true a domain cookie will be
// created, otherwise a host cookie will be created.
Create a test cookie. If |withDomain| is true a domain cookie will be
created, otherwise a host cookie will be created.
Create a test cookie . If |withDomain| is true a domain cookie will be created otherwise a host cookie will be created .
void CreateCookie(CefRefPtr<CefCookieManager> manager,
                  CefCookie& cookie,
                  bool withDomain,
                  bool sessionCookie,
                  CefRefPtr<CefWaitableEvent> event) {
  CefString(&cookie.name).FromASCII("my_cookie");
  CefString(&cookie.value).FromASCII("My Value");
  if (withDomain)
    CefString(&cookie.domain).FromASCII(kTestDomain);
  CefString(&cookie.path).FromASCII(kTestPath);
  if (!sessionCookie) {
    cookie.has_expires = true;
    cookie.expires.year = 2200;
    cookie.expires.month = 4;
    cookie.expires.day_of_week = 5;
    cookie.expires.day_of_month = 11;
  }
  CookieVector cookies;
  cookies.push_back(cookie);
  SetCookies(manager, kTestUrl, cookies, true, event);
}
void CreateCookie ( CefRefPtr < CefCookieManager > manager , CefCookie & cookie , bool withDomain , bool sessionCookie , CefRefPtr < CefWaitableEvent > event ) { CefString ( & cookie . name ) . FromASCII ( " " ) ; CefString ( & cookie . value ) . FromASCII ( " " ) ; if ( withDomain ) CefString ( & cookie . domain ) . FromASCII ( kTestDomain ) ; CefString ( & cookie . path ) . FromASCII ( kTestPath ) ; if ( ! sessionCookie ) { cookie . has_expires = true ; cookie . expires . year = 2200 ; cookie . expires . month = 4 ; cookie . expires . day_of_week = 5 ; cookie . expires . day_of_month = 11 ; } CookieVector cookies ; cookies . push_back ( cookie ) ; SetCookies ( manager , kTestUrl , cookies , true , event ) ; }
Create a test cookie.
Create a test cookie .