B2G/gecko/toolkit/components/places/tests/unit/test_history_sidebar.js
/**
 * Bug 485703 - Hide date containers not containing additional entries compared
 *              to previous ones.
 */
Bug 485703 - Hide date containers not containing additional entries compared
to previous ones.
Bug 485703 - Hide date containers not containing additional entries compared to previous ones .
function check_visit(aOffset) {
  var options = hs.getNewQueryOptions();
  options.resultType = options.RESULTS_AS_DATE_SITE_QUERY;
  var query = hs.getNewQuery();
  var result = hs.executeQuery(query, options);
  var root = result.root;
  root.containerOpen = true;
  var cc = root.childCount;
  var unexpected = [];
  switch (aOffset) {
    case 0:
      unexpected = ["Yesterday", "Last 7 days", "This month"];
      break;
    case -1:
      unexpected = ["Last 7 days", "This month"];
      break;
    case -3:
      unexpected = ["This month"];
      break;
    default:
  }
  print("Found containers:");
  for (var i = 0; i < cc; i++) {
    var node = root.getChild(i);
    print(node.title);
    do_check_eq(unexpected.indexOf(node.title), -1);
  }
  root.containerOpen = false;
}
function check_visit ( aOffset ) { var options = hs . getNewQueryOptions ( ) ; options . resultType = options . RESULTS_AS_DATE_SITE_QUERY ; var query = hs . getNewQuery ( ) ; var result = hs . executeQuery ( query , options ) ; var root = result . root ; root . containerOpen = true ; var cc = root . childCount ; var unexpected = [ ] ; switch ( aOffset ) { case 0 : unexpected = [ "Yesterday" , "Last 7 days" , "This month" ] ; break ; case - 1 : unexpected = [ "Last 7 days" , "This month" ] ; break ; case - 3 : unexpected = [ "This month" ] ; break ; default : } print ( "Found containers:" ) ; for ( var i = 0 ; i < cc ; i ++ ) { var node = root . getChild ( i ) ; print ( node . title ) ; do_check_eq ( unexpected . indexOf ( node . title ) , - 1 ) ; } root . containerOpen = false ; }
Bug 485703 - Hide date containers not containing additional entries compared
              to previous ones.
Bug 485703 - Hide date containers not containing additional entries compared to previous ones .
// Other containers are tested later.