зеркало из https://github.com/mozilla/pjs.git
Bug 419366 - Support "out of order" multiple word tag search in places organizer
This commit is contained in:
Родитель
0086a51f86
Коммит
064363dcb6
|
@ -78,85 +78,80 @@ function run_test() {
|
|||
var result = histsvc.executeQuery(query, options);
|
||||
var root = result.root;
|
||||
root.containerOpen = true;
|
||||
do_check_eq(root.childCount, 1);
|
||||
do_check_eq(root.childCount, 3);
|
||||
do_check_eq(root.getChild(0).uri, "http://site.tld/1");
|
||||
do_check_eq(root.getChild(1).uri, "http://site.tld/4");
|
||||
do_check_eq(root.getChild(2).uri, "http://site.tld/6");
|
||||
|
||||
query.searchTerms = "bar";
|
||||
result = histsvc.executeQuery(query, options);
|
||||
root = result.root;
|
||||
root.containerOpen = true;
|
||||
do_check_eq(root.childCount, 1);
|
||||
do_check_eq(root.childCount, 4);
|
||||
do_check_eq(root.getChild(0).uri, "http://site.tld/2");
|
||||
do_check_eq(root.getChild(1).uri, "http://site.tld/4");
|
||||
do_check_eq(root.getChild(2).uri, "http://site.tld/5");
|
||||
do_check_eq(root.getChild(3).uri, "http://site.tld/6");
|
||||
|
||||
query.searchTerms = "cheese";
|
||||
result = histsvc.executeQuery(query, options);
|
||||
root = result.root;
|
||||
root.containerOpen = true;
|
||||
do_check_eq(root.childCount, 1);
|
||||
do_check_eq(root.childCount, 3);
|
||||
do_check_eq(root.getChild(0).uri, "http://site.tld/3");
|
||||
do_check_eq(root.getChild(1).uri, "http://site.tld/5");
|
||||
do_check_eq(root.getChild(2).uri, "http://site.tld/6");
|
||||
|
||||
query.searchTerms = "foo bar";
|
||||
result = histsvc.executeQuery(query, options);
|
||||
root = result.root;
|
||||
root.containerOpen = true;
|
||||
do_check_eq(root.childCount, 3);
|
||||
do_check_eq(root.getChild(0).uri, "http://site.tld/1");
|
||||
do_check_eq(root.getChild(1).uri, "http://site.tld/2");
|
||||
do_check_eq(root.getChild(2).uri, "http://site.tld/4");
|
||||
do_check_eq(root.childCount, 2);
|
||||
do_check_eq(root.getChild(0).uri, "http://site.tld/4");
|
||||
do_check_eq(root.getChild(1).uri, "http://site.tld/6");
|
||||
|
||||
query.searchTerms = "bar foo";
|
||||
result = histsvc.executeQuery(query, options);
|
||||
root = result.root;
|
||||
root.containerOpen = true;
|
||||
do_check_eq(root.childCount, 2);
|
||||
do_check_eq(root.getChild(0).uri, "http://site.tld/1");
|
||||
do_check_eq(root.getChild(1).uri, "http://site.tld/2");
|
||||
do_check_eq(root.getChild(0).uri, "http://site.tld/4");
|
||||
do_check_eq(root.getChild(1).uri, "http://site.tld/6");
|
||||
|
||||
query.searchTerms = "bar cheese";
|
||||
result = histsvc.executeQuery(query, options);
|
||||
root = result.root;
|
||||
root.containerOpen = true;
|
||||
do_check_eq(root.childCount, 3);
|
||||
do_check_eq(root.getChild(0).uri, "http://site.tld/2");
|
||||
do_check_eq(root.getChild(1).uri, "http://site.tld/3");
|
||||
do_check_eq(root.getChild(2).uri, "http://site.tld/5");
|
||||
do_check_eq(root.childCount, 2);
|
||||
do_check_eq(root.getChild(0).uri, "http://site.tld/5");
|
||||
do_check_eq(root.getChild(1).uri, "http://site.tld/6");
|
||||
|
||||
query.searchTerms = "cheese bar";
|
||||
result = histsvc.executeQuery(query, options);
|
||||
root = result.root;
|
||||
root.containerOpen = true;
|
||||
do_check_eq(root.childCount, 2);
|
||||
do_check_eq(root.getChild(0).uri, "http://site.tld/2");
|
||||
do_check_eq(root.getChild(1).uri, "http://site.tld/3");
|
||||
do_check_eq(root.getChild(0).uri, "http://site.tld/5");
|
||||
do_check_eq(root.getChild(1).uri, "http://site.tld/6");
|
||||
|
||||
query.searchTerms = "foo bar cheese";
|
||||
result = histsvc.executeQuery(query, options);
|
||||
root = result.root;
|
||||
root.containerOpen = true;
|
||||
do_check_eq(root.childCount, 6);
|
||||
do_check_eq(root.getChild(0).uri, "http://site.tld/1");
|
||||
do_check_eq(root.getChild(1).uri, "http://site.tld/2");
|
||||
do_check_eq(root.getChild(2).uri, "http://site.tld/3");
|
||||
do_check_eq(root.getChild(3).uri, "http://site.tld/4");
|
||||
do_check_eq(root.getChild(4).uri, "http://site.tld/5");
|
||||
do_check_eq(root.getChild(5).uri, "http://site.tld/6");
|
||||
do_check_eq(root.childCount, 1);
|
||||
do_check_eq(root.getChild(0).uri, "http://site.tld/6");
|
||||
|
||||
query.searchTerms = "cheese foo bar";
|
||||
result = histsvc.executeQuery(query, options);
|
||||
root = result.root;
|
||||
root.containerOpen = true;
|
||||
do_check_eq(root.childCount, 4);
|
||||
do_check_eq(root.getChild(0).uri, "http://site.tld/1");
|
||||
do_check_eq(root.getChild(1).uri, "http://site.tld/2");
|
||||
do_check_eq(root.getChild(2).uri, "http://site.tld/3");
|
||||
do_check_eq(root.getChild(3).uri, "http://site.tld/4");
|
||||
do_check_eq(root.childCount, 1);
|
||||
do_check_eq(root.getChild(0).uri, "http://site.tld/6");
|
||||
|
||||
query.searchTerms = "cheese bar foo";
|
||||
result = histsvc.executeQuery(query, options);
|
||||
root = result.root;
|
||||
root.containerOpen = true;
|
||||
do_check_eq(root.childCount, 3);
|
||||
do_check_eq(root.getChild(0).uri, "http://site.tld/1");
|
||||
do_check_eq(root.getChild(1).uri, "http://site.tld/2");
|
||||
do_check_eq(root.getChild(2).uri, "http://site.tld/3");
|
||||
do_check_eq(root.childCount, 1);
|
||||
do_check_eq(root.getChild(0).uri, "http://site.tld/6");
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче