Revision control
Copy as Markdown
Other Tools
<?xml version="1.0"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
type="text/css"?>
title="510634: Wrong icons on bookmarks sidebar"
onload="runTest();">
<tree id="tree"
type="places"
flex="1">
<treecols>
<treecol label="Title" id="title" anonid="title" primary="true" ordinal="1" flex="1"/>
</treecols>
<treechildren flex="1"/>
</tree>
<script>
<![CDATA[
/**
*
* Ensures that properties for special queries are set on their tree nodes,
* even if PlacesUIUtils.leftPaneFolderId was not initialized.
*/
SimpleTest.waitForExplicitFinish();
function runTest() {
// We need to cache and restore this getter in order to simulate
let cachedLeftPaneFolderIdGetter =
PlacesUIUtils.__lookupGetter__("leftPaneFolderId");
let leftPaneFolderId = PlacesUIUtils.leftPaneFolderId;
// restore the getter
PlacesUIUtils.__defineGetter__("leftPaneFolderId", cachedLeftPaneFolderIdGetter);
// Setup the places tree contents.
let tree = document.getElementById("tree");
tree.place = "place:queryType=1&folder=" + leftPaneFolderId;
// Open All Bookmarks
PlacesUtils.asContainer(tree.view.nodeForTreeIndex(1)).containerOpen = true;
// The query-property is set on the title column for each row.
let titleColumn = tree.treeBoxObject.columns.getColumnAt(0);
["Tags", "AllBookmarks", "BookmarksToolbar",
"BookmarksMenu", "UnfiledBookmarks"].forEach(
function(aQueryName, aRow) {
let rowProperties = tree.view.getCellProperties(aRow, titleColumn).split(" ");
ok(rowProperties.includes("OrganizerQuery_" + aQueryName),
"OrganizerQuery_" + aQueryName + " is set");
}
);
// Close the root node
tree.result.root.containerOpen = false;
// Restore the getter for the next test.
PlacesUIUtils.__defineGetter__("leftPaneFolderId", cachedLeftPaneFolderIdGetter);
SimpleTest.finish();
}
]]>
</script>
</window>