B2G/gecko/browser/base/content/test/browser_sanitizeDialog.js
/**
 * Adds a form entry to history.
 *
 * @param aMinutesAgo
 *        The entry will be added this many minutes ago
 */
Adds a form entry to history.
@param aMinutesAgo
The entry will be added this many minutes ago
Adds a form entry to history . @param aMinutesAgo The entry will be added this many minutes ago
function addFormEntryWithMinutesAgo(aMinutesAgo) {
  let name = aMinutesAgo + "-minutes-ago";
  formhist.addEntry(name, "dummy");
  let db = formhist.DBConnection;
  let timestamp = now_uSec - (aMinutesAgo * kUsecPerMin);
  db.executeSimpleSQL("UPDATE moz_formhistory SET firstUsed = " +
                      timestamp +  " WHERE fieldname = '" + name + "'");
  is(formhist.nameExists(name), true,
     "Sanity check: form entry " + name + " should exist after creating it");
  return name;
}
function addFormEntryWithMinutesAgo ( aMinutesAgo ) { let name = aMinutesAgo + "-minutes-ago" ; formhist . addEntry ( name , "dummy" ) ; let db = formhist . DBConnection ; let timestamp = now_uSec - ( aMinutesAgo * kUsecPerMin ) ; db . executeSimpleSQL ( "UPDATE moz_formhistory SET firstUsed = " + timestamp + " WHERE fieldname = '" + name + "'" ) ; is ( formhist . nameExists ( name ) , true , "Sanity check: form entry " + name + " should exist after creating it" ) ; return name ; }
Adds a form entry to history.
Adds a form entry to history .
// Artifically age the entry to the proper vintage.