browser_sort_in_library.js File Reference

Go to the source code of this file.

Functions

function checkSort (aTree, aSortingMode, aSortingAnno)
 
function setSort (aOrganizerWin, aTree, aUnsortFirst, aShouldFail, aCol, aDir)
 
function testInvalid (aOrganizerWin, aPlaceContentTree)
 
function testSortByColAndDir (aOrganizerWin, aPlaceContentTree, aUnsortFirst)
 
function testSortByDir (aOrganizerWin, aPlaceContentTree, aUnsortFirst)
 
function test ()
 

Variables

const SORT_LOOKUP_TABLE
 
const DEFAULT_SORT_KEY = "TITLE"
 
let prevSortDir = null
 
let prevSortKey = null
 

Function Documentation

function checkSort (   aTree,
  aSortingMode,
  aSortingAnno 
)

Ensures that the sort of aTree is aSortingMode and aSortingAnno.

Parameters
aTreethe tree to check
aSortingModeone of the Ci.nsINavHistoryQueryOptions.SORT_BY_* constants
aSortingAnnochecked only if sorting mode is one of the Ci.nsINavHistoryQueryOptions.SORT_BY_ANNOTATION_* constants

Definition at line 103 of file browser_sort_in_library.js.

Here is the call graph for this function:

Here is the caller graph for this function:

function setSort (   aOrganizerWin,
  aTree,
  aUnsortFirst,
  aShouldFail,
  aCol,
  aDir 
)

Sets the sort of aTree.

Parameters
aOrganizerWinthe Places window
aTreethe tree to sort
aUnsortFirsttrue if the sort should be set to SORT_BY_NONE before sorting by aCol and aDir
aShouldFailtrue if setSortColumn should fail on aCol or aDir
aColthe column of aTree by which to sort
aDireither "ascending" or "descending"

Definition at line 140 of file browser_sort_in_library.js.

Here is the call graph for this function:

Here is the caller graph for this function:

function test ( )

Definition at line 268 of file browser_sort_in_library.js.

Here is the call graph for this function:

function testInvalid (   aOrganizerWin,
  aPlaceContentTree 
)

Tries sorting by an invalid column and sort direction.

Parameters
aOrganizerWinthe Places window
aPlaceContentTreethe placeContent tree in aOrganizerWin

Definition at line 190 of file browser_sort_in_library.js.

Here is the call graph for this function:

Here is the caller graph for this function:

function testSortByColAndDir (   aOrganizerWin,
  aPlaceContentTree,
  aUnsortFirst 
)

Tests sorting aPlaceContentTree by column only and then by both column and direction.

Parameters
aOrganizerWinthe Places window
aPlaceContentTreethe placeContent tree in aOrganizerWin
aUnsortFirsttrue if, before each sort we try, we should sort to SORT_BY_NONE

Definition at line 212 of file browser_sort_in_library.js.

Here is the call graph for this function:

Here is the caller graph for this function:

function testSortByDir (   aOrganizerWin,
  aPlaceContentTree,
  aUnsortFirst 
)

Tests sorting aPlaceContentTree by direction only.

Parameters
aOrganizerWinthe Places window
aPlaceContentTreethe placeContent tree in aOrganizerWin
aUnsortFirsttrue if, before each sort we try, we should sort to SORT_BY_NONE

Definition at line 256 of file browser_sort_in_library.js.

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

const DEFAULT_SORT_KEY = "TITLE"

Definition at line 83 of file browser_sort_in_library.js.

let prevSortDir = null

Definition at line 87 of file browser_sort_in_library.js.

let prevSortKey = null

Definition at line 88 of file browser_sort_in_library.js.

const SORT_LOOKUP_TABLE
Initial value:
= {
title: { key: "TITLE", dir: "ASCENDING" },
tags: { key: "TAGS", dir: "ASCENDING" },
url: { key: "URI", dir: "ASCENDING" },
date: { key: "DATE", dir: "DESCENDING" },
visitCount: { key: "VISITCOUNT", dir: "DESCENDING" },
keyword: { key: "KEYWORD", dir: "ASCENDING" },
dateAdded: { key: "DATEADDED", dir: "DESCENDING" },
lastModified: { key: "LASTMODIFIED", dir: "DESCENDING" },
description: { key: "ANNOTATION",
dir: "ASCENDING",
anno: "bookmarkProperties/description" }
}
_setDateDatepicker date
function url(spec)

Tests the following bugs:

Bug 443745 - View>Sort>of "alpha" sort items is default to Z>A instead of A>Z https://bugzilla.mozilla.org/show_bug.cgi?id=443745

Bug 444179 - Library>Views>Sort>Sort by Tags does nothing https://bugzilla.mozilla.org/show_bug.cgi?id=444179

Basically, fully tests sorting the placeContent tree in the Places Library window. Sorting is verified by comparing the nsINavHistoryResult returned by placeContent.getResult to the expected sort values.

Definition at line 64 of file browser_sort_in_library.js.