Bug 575132 - Intermittent failure in browser_history_sidebar_search.js - skip unexpected pages

This commit is contained in:
Marco Bonardo 2010-07-22 14:08:50 +02:00
parent 130127369e
commit 4beb474637

View File

@ -129,11 +129,17 @@ function check_sidebar_tree_order(aExpectedRows) {
var tree = sidebar.contentDocument.getElementById("historyTree");
var treeView = tree.view;
var rc = treeView.rowCount;
is(rc, aExpectedRows, "All expected tree rows are present");
var columns = tree.columns;
is(columns.count, 1, "There should be only 1 column in the sidebar");
var found = 0;
for (var r = 0; r < rc; r++) {
var node = treeView.nodeForTreeIndex(r);
// We could inherit visits from previous tests, skip them since they are
// not interesting for us.
if (pages.indexOf(node.uri) == -1)
continue;
is(node.uri, pages[r], "Node is in correct position based on its visit date");
found++;
}
ok(found, aExpectedRows, "Found all expected results");
}