B2G/gecko/toolkit/components/url-classifier/tests/unit/head_urlclassifier.js
/**
 * Simulates a failed database update.
 */
Simulates a failed database update.
Simulates a failed database update .
function doErrorUpdate(tables, success, failure) {
  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) { success(errorCode); },
    updateSuccess: function(requestedTimeout) { failure(requestedTimeout); }
  };
  dbservice.beginUpdate(listener, tables, null);
  dbservice.beginStream("", "");
  dbservice.cancelUpdate();
}
function doErrorUpdate ( tables , success , failure ) { 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 ) { success ( errorCode ) ; } , updateSuccess : function ( requestedTimeout ) { failure ( requestedTimeout ) ; } } ; dbservice . beginUpdate ( listener , tables , null ) ; dbservice . beginStream ( "" , "" ) ; dbservice . cancelUpdate ( ) ; }
Simulates a failed database update.
Simulates a failed database update .