B2G/gecko/toolkit/components/url-classifier/tests/unit/head_urlclassifier.js
/**
 * Performs an update of the dbservice manually, bypassing the stream updater
 */
Performs an update of the dbservice manually, bypassing the stream updater
Performs an update of the dbservice manually bypassing the stream updater
function doSimpleUpdate(updateText, success, failure, clientKey) {
  var listener = {
    QueryInterface: function(iid)
    {
      if (iid.equals(Ci.nsISupports) ||
          iid.equals(Ci.nsIUrlClassifierUpdateObserver))
        return this;
      throw Cr.NS_ERROR_NO_INTERFACE;
    },
    updateUrlRequested: function(url) { },
    streamFinished: function(status) { },
    updateError: function(errorCode) { failure(errorCode); },
    updateSuccess: function(requestedTimeout) { success(requestedTimeout); }
  };
  dbservice.beginUpdate(listener,
                        "test-phish-simple,test-malware-simple",
                        clientKey);
  dbservice.beginStream("", "");
  dbservice.updateStream(updateText);
  dbservice.finishStream();
  dbservice.finishUpdate();
}
function doSimpleUpdate ( updateText , success , failure , clientKey ) { var listener = { QueryInterface : function ( iid ) { if ( iid . equals ( Ci . nsISupports ) || iid . equals ( Ci . nsIUrlClassifierUpdateObserver ) ) return this ; throw Cr . NS_ERROR_NO_INTERFACE ; } , updateUrlRequested : function ( url ) { } , streamFinished : function ( status ) { } , updateError : function ( errorCode ) { failure ( errorCode ) ; } , updateSuccess : function ( requestedTimeout ) { success ( requestedTimeout ) ; } } ; dbservice . beginUpdate ( listener , "test-phish-simple,test-malware-simple" , clientKey ) ; dbservice . beginStream ( "" , "" ) ; dbservice . updateStream ( updateText ) ; dbservice . finishStream ( ) ; dbservice . finishUpdate ( ) ; }
Performs an update of the dbservice manually, bypassing the stream updater
Performs an update of the dbservice manually bypassing the stream updater