B2G/gecko/toolkit/components/places/tests/unit/test_399264_string_to_query.js
/**
 * Obtains the id of the folder obtained from the query.
 *
 * @param aQuery
 *        The query to obtain the folder id from.
 * @returns the folder id of the folder of the root node of the query.
 */
Obtains the id of the folder obtained from the query.
@param aQuery
The query to obtain the folder id from.
@returns the folder id of the folder of the root node of the query.
Obtains the id of the folder obtained from the query . @param aQuery The query to obtain the folder id from . @returns the folder id of the folder of the root node of the query .
function folder_id(aQuery)
{
  var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
           getService(Ci.nsINavHistoryService);
  dump("Checking query '" + aQuery + "'\n");
  var options = { };
  var queries = { };
  var size = { };
  hs.queryStringToQueries(aQuery, queries, size, options);
  var result = hs.executeQueries(queries.value, size.value, options.value);
  var root = result.root;
  root.containerOpen = true;
  do_check_true(root.hasChildren);
  var folderID = root.getChild(0).parent.itemId;
  root.containerOpen = false;
  return folderID;
}
function folder_id ( aQuery ) { var hs = Cc [ "@mozilla.org/browser/nav-history-service;1" ] . getService ( Ci . nsINavHistoryService ) ; dump ( "Checking query '" + aQuery + "'\n" ) ; var options = { } ; var queries = { } ; var size = { } ; hs . queryStringToQueries ( aQuery , queries , size , options ) ; var result = hs . executeQueries ( queries . value , size . value , options . value ) ; var root = result . root ; root . containerOpen = true ; do_check_true ( root . hasChildren ) ; var folderID = root . getChild ( 0 ) . parent . itemId ; root . containerOpen = false ; return folderID ; }
Obtains the id of the folder obtained from the query.
Obtains the id of the folder obtained from the query .