65 title: {
key:
"TITLE",
dir:
"ASCENDING" },
66 tags: {
key:
"TAGS",
dir:
"ASCENDING" },
69 visitCount: {
key:
"VISITCOUNT",
dir:
"DESCENDING" },
70 keyword: {
key:
"KEYWORD",
dir:
"ASCENDING" },
71 dateAdded: {
key:
"DATEADDED",
dir:
"DESCENDING" },
72 lastModified: {
key:
"LASTMODIFIED",
dir:
"DESCENDING" },
73 description: {
key:
"ANNOTATION",
75 anno:
"bookmarkProperties/description" }
106 let res = aTree.getResult();
108 "sanity check: placeContent.getResult() should not return null");
111 is(res.sortingMode, aSortingMode,
112 "column should now have sortingMode " + aSortingMode);
115 if ([
Ci.nsINavHistoryQueryOptions.SORT_BY_ANNOTATION_ASCENDING,
116 Ci.nsINavHistoryQueryOptions.SORT_BY_ANNOTATION_DESCENDING].
118 is(res.sortingAnnotation, aSortingAnno,
119 "column should now have sorting annotation " + aSortingAnno);
140 function setSort(aOrganizerWin, aTree, aUnsortFirst, aShouldFail, aCol, aDir) {
142 aOrganizerWin.ViewMenu.setSortColumn();
143 checkSort(aTree,
Ci.nsINavHistoryQueryOptions.SORT_BY_NONE,
"");
152 aOrganizerWin.ViewMenu.setSortColumn(aCol, aDir);
155 if (!aCol && !aDir) {
174 is(failed, !!aShouldFail,
175 "setSortColumn on column " +
176 (aCol ? aCol.getAttribute(
"anonid") :
"(no column)") +
177 " with direction " + (aDir ||
"(no direction)") +
178 " and table previously " + (aUnsortFirst ?
"unsorted" :
"sorted") +
179 " should " + (aShouldFail ?
"" :
"not ") +
"fail");
192 let bogusCol = document.createElement(
"treecol");
193 bogusCol.setAttribute(
"anonid",
"bogusColumn");
194 setSort(aOrganizerWin, aPlaceContentTree,
true,
true, bogusCol,
"ascending");
197 setSort(aOrganizerWin, aPlaceContentTree,
false,
false,
null,
"bogus dir");
198 checkSort(aPlaceContentTree,
Ci.nsINavHistoryQueryOptions.SORT_BY_NONE,
"");
213 let cols = aPlaceContentTree.getElementsByTagName(
"treecol");
214 ok(cols.length > 0,
"sanity check: placeContent should contain columns");
216 for (let
i = 0;
i < cols.length;
i++) {
217 let col = cols.item(
i);
218 ok(col.hasAttribute(
"anonid"),
219 "sanity check: column " + col.id +
" should have anonid");
221 let colId = col.getAttribute(
"anonid");
223 "sanity check: unexpected placeContent column anonid");
226 "SORT_BY_" + SORT_LOOKUP_TABLE[colId].key +
"_" +
227 (aUnsortFirst ? SORT_LOOKUP_TABLE[colId].dir :
prevSortDir);
228 let expectedSortMode =
Ci.nsINavHistoryQueryOptions[sortConst];
229 let expectedAnno = SORT_LOOKUP_TABLE[colId].anno ||
"";
232 setSort(aOrganizerWin, aPlaceContentTree, aUnsortFirst,
false, col);
233 checkSort(aPlaceContentTree, expectedSortMode, expectedAnno);
236 [
"ascending",
"descending"].forEach(
function (
dir) {
238 "SORT_BY_" + SORT_LOOKUP_TABLE[colId].key +
"_" +
dir.toUpperCase();
239 let expectedSortMode =
Ci.nsINavHistoryQueryOptions[sortConst];
240 setSort(aOrganizerWin, aPlaceContentTree, aUnsortFirst,
false, col,
dir);
241 checkSort(aPlaceContentTree, expectedSortMode, expectedAnno);
257 [
"ascending",
"descending"].forEach(
function (
dir) {
259 let sortConst =
"SORT_BY_" + key +
"_" +
dir.toUpperCase();
260 let expectedSortMode =
Ci.nsINavHistoryQueryOptions[sortConst];
261 setSort(aOrganizerWin, aPlaceContentTree, aUnsortFirst,
false,
null,
dir);
262 checkSort(aPlaceContentTree, expectedSortMode,
"");
271 let
ww =
Cc[
"@mozilla.org/embedcomp/window-watcher;1"].
276 if (aTopic ===
"domwindowopened") {
277 ww.unregisterNotification(
this);
278 let
win = aSubject.QueryInterface(
Ci.nsIDOMWindow);
279 win.addEventListener(
"load",
function onLoad(
event) {
280 win.removeEventListener(
"load",
onLoad,
false);
281 executeSoon(
function () {
282 let tree = win.document.getElementById(
"placeContent");
283 isnot(tree,
null,
"sanity check: placeContent tree should exist");
291 setSort(win, tree,
false,
false);
301 ww.registerNotification(windowObserver);
303 "chrome://browser/content/places/places.xul",
305 "chrome,toolbar=yes,dialog=no,resizable",
getService(Ci.sbIFaceplateManager)
return elem filter &&elem filter indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity
function setSort(aOrganizerWin, aTree, aUnsortFirst, aShouldFail, aCol, aDir)
function testSortByColAndDir(aOrganizerWin, aPlaceContentTree, aUnsortFirst)
function testSortByDir(aOrganizerWin, aPlaceContentTree, aUnsortFirst)
function checkSort(aTree, aSortingMode, aSortingAnno)
_getSelectedPageStyle s i
function testInvalid(aOrganizerWin, aPlaceContentTree)
_updateTextAndScrollDataForFrame aData
sbDeviceFirmwareAutoCheckForUpdate prototype observe