B2G/gecko/toolkit/components/places/tests/unit/test_bookmarks_restore_notification.js
/**
 * Checks that all of the bookmarks created for |uris| exist.  It works by
 * creating one query per URI and then ORing all the queries.  The number of
 * results returned should be uris.length.
 */
Checks that all of the bookmarks created for |uris| exist.  It works by
creating one query per URI and then ORing all the queries.  The number of
results returned should be uris.length.
Checks that all of the bookmarks created for |uris| exist . It works by creating one query per URI and then ORing all the queries . The number of results returned should be uris . length .
function checkBookmarksExist() {
  var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
           getService(Ci.nsINavHistoryService);
  var queries = uris.map(function (u) {
    var q = hs.getNewQuery();
    q.uri = uri(u);
    return q;
  });
  var options = hs.getNewQueryOptions();
  options.queryType = options.QUERY_TYPE_BOOKMARKS;
  var root = hs.executeQueries(queries, uris.length, options).root;
  root.containerOpen = true;
  do_check_eq(root.childCount, uris.length);
  root.containerOpen = false;
}
function checkBookmarksExist ( ) { var hs = Cc [ "@mozilla.org/browser/nav-history-service;1" ] . getService ( Ci . nsINavHistoryService ) ; var queries = uris . map ( function ( u ) { var q = hs . getNewQuery ( ) ; q . uri = uri ( u ) ; return q ; } ) ; var options = hs . getNewQueryOptions ( ) ; options . queryType = options . QUERY_TYPE_BOOKMARKS ; var root = hs . executeQueries ( queries , uris . length , options ) . root ; root . containerOpen = true ; do_check_eq ( root . childCount , uris . length ) ; root . containerOpen = false ; }
Checks that all of the bookmarks created for |uris| exist.
Checks that all of the bookmarks created for |uris| exist .