B2G/gecko/browser/components/places/tests/browser/browser_sort_in_library.js
/**
 * Tests sorting aPlaceContentTree by direction only.
 *
 * @param aOrganizerWin
 *        the Places window
 * @param aPlaceContentTree
 *        the placeContent tree in aOrganizerWin
 * @param aUnsortFirst
 *        true if, before each sort we try, we should sort to SORT_BY_NONE
 */
Tests sorting aPlaceContentTree by direction only.
@param aOrganizerWin
the Places window
@param aPlaceContentTree
the placeContent tree in aOrganizerWin
@param aUnsortFirst
true if, before each sort we try, we should sort to SORT_BY_NONE
Tests sorting aPlaceContentTree by direction only . @param aOrganizerWin the Places window @param aPlaceContentTree the placeContent tree in aOrganizerWin @param aUnsortFirst true if before each sort we try we should sort to SORT_BY_NONE
function testSortByDir(aOrganizerWin, aPlaceContentTree, aUnsortFirst) {
  ["ascending", "descending"].forEach(function (dir) {
    let key = (aUnsortFirst ? DEFAULT_SORT_KEY : prevSortKey);
    let sortConst = "SORT_BY_" + key + "_" + dir.toUpperCase();
    let expectedSortMode = Ci.nsINavHistoryQueryOptions[sortConst];
    setSort(aOrganizerWin, aPlaceContentTree, aUnsortFirst, false, null, dir);
    checkSort(aPlaceContentTree, expectedSortMode, "");
  });
}
function testSortByDir ( aOrganizerWin , aPlaceContentTree , aUnsortFirst ) { [ "ascending" , "descending" ] . forEach ( function ( dir ) { let key = ( aUnsortFirst ? DEFAULT_SORT_KEY : prevSortKey ) ; let sortConst = "SORT_BY_" + key + "_" + dir . toUpperCase ( ) ; let expectedSortMode = Ci . nsINavHistoryQueryOptions [ sortConst ] ; setSort ( aOrganizerWin , aPlaceContentTree , aUnsortFirst , false , null , dir ) ; checkSort ( aPlaceContentTree , expectedSortMode , "" ) ; } ) ; }
Tests sorting aPlaceContentTree by direction only.
Tests sorting aPlaceContentTree by direction only .