xpcshell unit test fix from async location bar landing on a CLOSED TREE. no bug. r=dietrich
authorShawn Wilsher <sdwilsh@shawnwilsher.com>
Thu, 30 Jul 2009 13:53:06 -0700
changeset 26279 b307a643012f62992fe9cd72f1dc9db8961481b3
parent 26278 90efe188b7b1f2d8921d2be15c90c9a68dfe997b
child 26280 5e82a8ce486243db2244c981ea1588ec66303965
push id1834
push userclokep@gmail.com
push dateMon, 23 Jan 2017 21:48:40 +0000
treeherdercomm-beta@293cffe83e59 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdietrich
xpcshell unit test fix from async location bar landing on a CLOSED TREE. no bug. r=dietrich
suite/common/places/tests/autocomplete/test_autocomplete_on_value_removed_479089.js
--- 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;
 }