B2G/gecko/browser/components/places/tests/browser/browser_sort_in_library.js
/**
 * Ensures that the sort of aTree is aSortingMode and aSortingAnno.
 *
 * @param aTree
 *        the tree to check
 * @param aSortingMode
 *        one of the Ci.nsINavHistoryQueryOptions.SORT_BY_* constants
 * @param aSortingAnno
 *        checked only if sorting mode is one of the
 *        Ci.nsINavHistoryQueryOptions.SORT_BY_ANNOTATION_* constants
 */
Ensures that the sort of aTree is aSortingMode and aSortingAnno.
@param aTree
the tree to check
@param aSortingMode
one of the Ci.nsINavHistoryQueryOptions.SORT_BY_* constants
@param aSortingAnno
checked only if sorting mode is one of the
Ci.nsINavHistoryQueryOptions.SORT_BY_ANNOTATION_* constants
Ensures that the sort of aTree is aSortingMode and aSortingAnno . @param aTree the tree to check @param aSortingMode one of the Ci . nsINavHistoryQueryOptions . SORT_BY_ * constants @param aSortingAnno checked only if sorting mode is one of the Ci . nsINavHistoryQueryOptions . SORT_BY_ANNOTATION_ * constants
function checkSort(aTree, aSortingMode, aSortingAnno) {
  let res = aTree.result;
  isnot(res, null,
        "sanity check: placeContent.result should not return null");
  is(res.sortingMode, aSortingMode,
     "column should now have sortingMode " + aSortingMode);
  if ([Ci.nsINavHistoryQueryOptions.SORT_BY_ANNOTATION_ASCENDING,
       Ci.nsINavHistoryQueryOptions.SORT_BY_ANNOTATION_DESCENDING].
      indexOf(aSortingMode) >= 0) {
    is(res.sortingAnnotation, aSortingAnno,
       "column should now have sorting annotation " + aSortingAnno);
  }
}
function checkSort ( aTree , aSortingMode , aSortingAnno ) { let res = aTree . result ; isnot ( res , null , "sanity check: placeContent.result should not return null" ) ; is ( res . sortingMode , aSortingMode , "column should now have sortingMode " + aSortingMode ) ; if ( [ Ci . nsINavHistoryQueryOptions . SORT_BY_ANNOTATION_ASCENDING , Ci . nsINavHistoryQueryOptions . SORT_BY_ANNOTATION_DESCENDING ] . indexOf ( aSortingMode ) >= 0 ) { is ( res . sortingAnnotation , aSortingAnno , "column should now have sorting annotation " + aSortingAnno ) ; } }
Ensures that the sort of aTree is aSortingMode and aSortingAnno.
Ensures that the sort of aTree is aSortingMode and aSortingAnno .
// The placeContent tree's sort is determined by the nsINavHistoryResult it // stores.  Get it and check that the sort is what the caller expects. // Check sortingMode. // Check sortingAnnotation, but only if sortingMode is ANNOTATION.