42 const Cc = Components.classes;
43 const Ci = Components.interfaces;
44 const Cr = Components.results;
46 var
hs =
Cc[
"@mozilla.org/browser/nav-history-service;1"].
48 var
bh =
hs.QueryInterface(
Ci.nsIBrowserHistory);
49 var
ios =
Cc[
"@mozilla.org/network/io-service;1"].
55 var
sidebar = document.getElementById(
"sidebar");
58 var visitId =
hs.addVisit(aURI,
69 "http://sidebar.mozilla.org/a",
70 "http://sidebar.mozilla.org/b",
71 "http://sidebar.mozilla.org/c",
72 "http://www.mozilla.org/d",
84 var time = Date.now();
85 for (var
i = 0;
i < pages.length;
i++) {
89 sidebar.addEventListener(
"load",
function() {
90 sidebar.removeEventListener(
"load",
arguments.callee,
true);
91 executeSoon(
function() {
93 sidebar.contentDocument.getElementById(
"bylastvisited").doCommand();
95 var searchBox = sidebar.contentDocument.getElementById(
"search-box");
96 ok(searchBox,
"search box is in context");
97 searchBox.value =
"sidebar.mozilla";
98 searchBox.doCommand();
100 searchBox.value =
"";
101 searchBox.doCommand();
105 toggleSidebar(
"viewHistorySidebar",
false);
111 toggleSidebar(
"viewHistorySidebar",
true);
115 var tree = sidebar.contentDocument.getElementById(
"historyTree");
117 var rc = treeView.rowCount;
118 is(rc, aExpectedRows,
"All expected tree rows are present");
120 is(columns.count, 1,
"There should be only 1 column in the sidebar");
121 for (var r = 0; r < rc; r++) {
122 var
node = treeView.nodeForTreeIndex(r);
123 is(node.uri, pages[r],
"Node is in correct position based on its visit date");
getService(Ci.sbIFaceplateManager)
return!aWindow arguments!aWindow arguments[0]
_getSelectedPageStyle s i