B2G/gecko/toolkit/components/url-classifier/tests/unit/head_urlclassifier.js
// Runs a set of updates, and then checks a set of assertions.
Runs a set of updates, and then checks a set of assertions.
Runs a set of updates and then checks a set of assertions .
function doUpdateTest(updates, assertions, successCallback, errorCallback, clientKey) {
  var errorUpdate = function() {
    checkAssertions(assertions, errorCallback);
  }
  var runUpdate = function() {
    if (updates.length > 0) {
      var update = updates.shift();
      doStreamUpdate(update, runUpdate, errorUpdate, null, clientKey);
    } else {
      checkAssertions(assertions, successCallback);
    }
  }
  runUpdate();
}
function doUpdateTest ( updates , assertions , successCallback , errorCallback , clientKey ) { var errorUpdate = function ( ) { checkAssertions ( assertions , errorCallback ) ; } var runUpdate = function ( ) { if ( updates . length > 0 ) { var update = updates . shift ( ) ; doStreamUpdate ( update , runUpdate , errorUpdate , null , clientKey ) ; } else { checkAssertions ( assertions , successCallback ) ; } } runUpdate ( ) ; }
Runs a set of updates, and then checks a set of assertions.
Runs a set of updates and then checks a set of assertions .