зеркало из https://github.com/mozilla/pjs.git
Bug 419068 - Allow tagged pages to mingle with non-tagged autocomplete results
This commit is contained in:
Родитель
c2c8417f6d
Коммит
0b2da9c62b
|
@ -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");
|
||||
}
|
||||
];
|
||||
|
|
Загрузка…
Ссылка в новой задаче