From 81032bc0d85393633eb4986005b2516b2d61d0e3 Mon Sep 17 00:00:00 2001 From: "edward.lee@engineering.uiuc.edu" Date: Mon, 25 Feb 2008 16:22:09 -0800 Subject: [PATCH] Bug 419068 - Allow tagged pages to mingle with non-tagged autocomplete results --- .../components/places/tests/unit/test_frecency.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/toolkit/components/places/tests/unit/test_frecency.js b/toolkit/components/places/tests/unit/test_frecency.js index c68ac41011cd..9e7cbaf85445 100644 --- a/toolkit/components/places/tests/unit/test_frecency.js +++ b/toolkit/components/places/tests/unit/test_frecency.js @@ -43,6 +43,9 @@ * this also tests for non-empty inputs as well. Because the interactions among * *DIFFERENT* visit counts and visit dates is not well defined, this test * holds one of the two values constant when modifying the other. + * + * Also test bug 419068 to make sure tagged pages don't necessarily have to be + * first in the results. */ var current_test = 0; @@ -142,6 +145,8 @@ function ensure_results(uris, searchTerm) try { var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].getService(Ci.nsINavHistoryService); var bhist = histsvc.QueryInterface(Ci.nsIBrowserHistory); + var tagssvc = Cc["@mozilla.org/browser/tagging-service;1"]. + getService(Ci.nsITaggingService); } catch(ex) { do_throw("Could not get history service\n"); } @@ -177,24 +182,28 @@ function() { prepTest("0: same count, different date"); setCountDate(uri1, c1, d1); setCountDate(uri2, c1, d2); + tagssvc.tagURI(uri1, ["site"]); ensure_results([uri1, uri2], ""); }, function() { prepTest("1: same count, different date"); setCountDate(uri1, c1, d2); setCountDate(uri2, c1, d1); + tagssvc.tagURI(uri1, ["site"]); ensure_results([uri2, uri1], ""); }, function() { prepTest("2: different count, same date"); setCountDate(uri1, c1, d1); setCountDate(uri2, c2, d1); + tagssvc.tagURI(uri1, ["site"]); ensure_results([uri1, uri2], ""); }, function() { prepTest("3: different count, same date"); setCountDate(uri1, c2, d1); setCountDate(uri2, c1, d1); + tagssvc.tagURI(uri1, ["site"]); ensure_results([uri2, uri1], ""); }, @@ -203,24 +212,28 @@ function() { prepTest("4: same count, different date"); setCountDate(uri1, c1, d1); setCountDate(uri2, c1, d2); + tagssvc.tagURI(uri1, ["site"]); ensure_results([uri1, uri2], "site"); }, function() { prepTest("5: same count, different date"); setCountDate(uri1, c1, d2); setCountDate(uri2, c1, d1); + tagssvc.tagURI(uri1, ["site"]); ensure_results([uri2, uri1], "site"); }, function() { prepTest("6: different count, same date"); setCountDate(uri1, c1, d1); setCountDate(uri2, c2, d1); + tagssvc.tagURI(uri1, ["site"]); ensure_results([uri1, uri2], "site"); }, function() { prepTest("7: different count, same date"); setCountDate(uri1, c2, d1); setCountDate(uri2, c1, d1); + tagssvc.tagURI(uri1, ["site"]); ensure_results([uri2, uri1], "site"); } ];