B2G/gecko/extensions/cookie/test/unit/head_cookies.js
// the cookie count against 'expected' after each set.
the cookie count against 'expected' after each set.
the cookie count against ' expected ' after each set .
function do_set_cookies(uri, channel, session, expected) {
  let suffix = session ? "" : "; max-age=1000";
  Services.cookies.setCookieString(uri, null, "oh=hai" + suffix, null);
  do_check_eq(Services.cookiemgr.countCookiesFromHost(uri.host), expected[0]);
  Services.cookies.setCookieString(uri, null, "can=has" + suffix, channel);
  do_check_eq(Services.cookiemgr.countCookiesFromHost(uri.host), expected[1]);
  , from http
  Services.cookies.setCookieStringFromHttp(uri, null, null, "cheez=burger" + suffix, null, null);
  do_check_eq(Services.cookiemgr.countCookiesFromHost(uri.host), expected[2]);
  , from http
  Services.cookies.setCookieStringFromHttp(uri, null, null, "hot=dog" + suffix, null, channel);
  do_check_eq(Services.cookiemgr.countCookiesFromHost(uri.host), expected[3]);
}
function do_set_cookies ( uri , channel , session , expected ) { let suffix = session ? "" : "; max-age=1000" ; Services . cookies . setCookieString ( uri , null , "oh=hai" + suffix , null ) ; do_check_eq ( Services . cookiemgr . countCookiesFromHost ( uri . host ) , expected [ 0 ] ) ; Services . cookies . setCookieString ( uri , null , "can=has" + suffix , channel ) ; do_check_eq ( Services . cookiemgr . countCookiesFromHost ( uri . host ) , expected [ 1 ] ) ; Services . cookies . setCookieStringFromHttp ( uri , null , null , "cheez=burger" + suffix , null , null ) ; do_check_eq ( Services . cookiemgr . countCookiesFromHost ( uri . host ) , expected [ 2 ] ) ; Services . cookies . setCookieStringFromHttp ( uri , null , null , "hot=dog" + suffix , null , channel ) ; do_check_eq ( Services . cookiemgr . countCookiesFromHost ( uri . host ) , expected [ 3 ] ) ; }
the cookie count against 'expected' after each set.
the cookie count against ' expected ' after each set .
// without channel // with channel // without channel, from http // with channel, from http