xpcshell unit test fix from async location bar landing on a CLOSED TREE. no bug. r=dietrich
xpcshell unit test fix from async location bar landing on a CLOSED TREE. no bug. r=dietrich
--- a/suite/common/places/tests/autocomplete/test_autocomplete_on_value_removed_479089.js
+++ b/suite/common/places/tests/autocomplete/test_autocomplete_on_value_removed_479089.js
@@ -48,36 +48,37 @@ var ios = Cc["@mozilla.org/network/io-se
getService(Components.interfaces.nsIIOService);
var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].
getService(Ci.nsINavHistoryService);
function run_test()
{
// QI to nsIAutoCompleteSimpleResultListener
- var historyService = histsvc.QueryInterface(Components.interfaces.nsIAutoCompleteSimpleResultListener);
+ var listener = Cc["@mozilla.org/autocomplete/search;1?name=history"].
+ getService(Components.interfaces.nsIAutoCompleteSimpleResultListener);
// add history visit
var now = Date.now() * 1000;
var uri = ios.newURI("http://foo.mozilla.com/", null, null);
var ref = ios.newURI("http://mozilla.com/", null, null);
var visit = histsvc.addVisit(uri, now, ref, 1, false, 0);
// create a query object
- var query = historyService.getNewQuery();
+ var query = histsvc.getNewQuery();
// create the options object we will never use
- var options = historyService.getNewQueryOptions();
+ var options = histsvc.getNewQueryOptions();
// look for this uri only
query.uri = uri;
// execute
- var queryRes = historyService.executeQuery(query, options);
+ var queryRes = histsvc.executeQuery(query, options);
// open the result container
queryRes.root.containerOpen = true;
// debug queries
// dump_table("moz_places_view");
do_check_eq(queryRes.root.childCount, 1);
// call the untested code path
- historyService.onValueRemoved(null, uri.spec, true);
+ listener.onValueRemoved(null, uri.spec, true);
// make sure it is GONE from the DB
do_check_eq(queryRes.root.childCount, 0);
// close the container
queryRes.root.containerOpen = false;
}