B2G/gecko/extensions/cookie/test/file_testloadflags.js
// Check headers, and count and check cookies.
Check headers, and count and check cookies.
Check headers and count and check cookies .
function runTest() {
  document.cookie = "o=noes";
  is(gHeaders, gExpectedHeaders, "number of observed request headers");
  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
  var cs = Components.classes["@mozilla.org/cookiemanager;1"]
                     .getService(Components.interfaces.nsICookieManager);
  var count = 0;
  var list = cs.enumerator;
  while (list.hasMoreElements()) {
    var cookie = list.getNext().QueryInterface(Components.interfaces.nsICookie);
    ok(true, "cookie: " + cookie);
    ok(true, "cookie host " + cookie.host + " path " + cookie.path + " name " + cookie.name +
       " value " + cookie.value + " isSecure " + cookie.isSecure + " expires " + cookie.expires);
    ++count;
  }
  is(count, gExpectedCookies, "total number of cookies");
  cs.removeAll();
  finishTest();
}
function runTest ( ) { document . cookie = "o=noes" ; is ( gHeaders , gExpectedHeaders , "number of observed request headers" ) ; netscape . security . PrivilegeManager . enablePrivilege ( "UniversalXPConnect" ) ; var cs = Components . classes [ "@mozilla.org/cookiemanager;1" ] . getService ( Components . interfaces . nsICookieManager ) ; var count = 0 ; var list = cs . enumerator ; while ( list . hasMoreElements ( ) ) { var cookie = list . getNext ( ) . QueryInterface ( Components . interfaces . nsICookie ) ; ok ( true , "cookie: " + cookie ) ; ok ( true , "cookie host " + cookie . host + " path " + cookie . path + " name " + cookie . name + " value " + cookie . value + " isSecure " + cookie . isSecure + " expires " + cookie . expires ) ; ++ count ; } is ( count , gExpectedCookies , "total number of cookies" ) ; cs . removeAll ( ) ; finishTest ( ) ; }
Check headers, and count and check cookies.
Check headers and count and check cookies .
// set a cookie from a domain of "localhost"