Bug 570720 - Intermittent failure in browser_library_search.js when default livemark feed includes "dummy". r=mak

This commit is contained in:
Drew Willcoxon 2010-06-09 14:08:11 -07:00
parent bf0208ab74
commit 53df27b14f
2 changed files with 11 additions and 9 deletions

View File

@ -54,6 +54,7 @@ _BROWSER_TEST_FILES = \
browser_sort_in_library.js \
browser_library_open_leak.js \
browser_library_panel_leak.js \
browser_library_search.js \
browser_history_sidebar_search.js \
browser_bookmarksProperties.js \
browser_forgetthissite_single.js \
@ -66,8 +67,5 @@ _BROWSER_TEST_FILES = \
browser_library_infoBox.js \
$(NULL)
# Test disabled because it's failing every time! See bug 570720.
# browser_library_search.js \
libs:: $(_BROWSER_TEST_FILES)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)

View File

@ -59,7 +59,7 @@
* 6. if folder scope was clicked, searches again and ensures folder scope
* remains selected.
*/
const TEST_URL = "http://dummy.mozilla.org/";
// Add your tests here. Each is a function that's called by testHelper().
@ -224,11 +224,15 @@ function search(aFolderId, aSearchStr, aExpectedScopeButtonId) {
if (getSelectedScopeButtonId() == "scopeBarHistory" ||
getSelectedScopeButtonId() == "scopeBarAll" ||
aFolderId == PlacesUtils.bookmarks.unfiledBookmarksFolder) {
// Check that search has returned a valid result.
contentTree.view.selection.select(0);
var foundNode = contentTree.selectedNode;
isnot(foundNode, null, "Found a valid node");
is(foundNode.uri, TEST_URL);
// Check that the target node exists in the tree's search results.
var node = null;
for (var i = 0; i < contentTree.view.rowCount; i++) {
node = contentTree.view.nodeForTreeIndex(i);
if (node.uri === TEST_URL)
break;
}
isnot(node, null, "At least the target node should be in the tree");
is(node.uri, TEST_URL, "URI of node should match target URL");
}
}
else {