B2G/gecko/toolkit/components/autocomplete/tests/unit/test_440866.js
/**
 * Helper to register an AutoCompleteSearch with the given name.
 * Allows the AutoCompleteController to find the search.
 */
Helper to register an AutoCompleteSearch with the given name.
Allows the AutoCompleteController to find the search.
Helper to register an AutoCompleteSearch with the given name . Allows the AutoCompleteController to find the search .
function registerAutoCompleteSearch(aSearch) {
  var name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
  var uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].
                      getService(Ci.nsIUUIDGenerator);
  var cid = uuidGenerator.generateUUID();
  var desc = "Test AutoCompleteSearch";
  var componentManager = Components.manager
                                   .QueryInterface(Ci.nsIComponentRegistrar);
  componentManager.registerFactory(cid, desc, name, aSearch);
  aSearch.cid = cid;
}
function registerAutoCompleteSearch ( aSearch ) { var name = "@mozilla.org/autocomplete/search;1?name=" + aSearch . name ; var uuidGenerator = Cc [ "@mozilla.org/uuid-generator;1" ] . getService ( Ci . nsIUUIDGenerator ) ; var cid = uuidGenerator . generateUUID ( ) ; var desc = "Test AutoCompleteSearch" ; var componentManager = Components . manager . QueryInterface ( Ci . nsIComponentRegistrar ) ; componentManager . registerFactory ( cid , desc , name , aSearch ) ; aSearch . cid = cid ; }
Helper to register an AutoCompleteSearch with the given name.
Helper to register an AutoCompleteSearch with the given name .
// Keep the id on the object so we can unregister later