function continueTesting(opt_asyncTestFailure) {
  var now = performance.now();
  if (testName) {
    console.log(
        'TEST ' + testName +
        ' complete, status=' + (opt_asyncTestFailure ? 'FAIL' : 'PASS') +
        ', duration=' + Math.round(now - testStartTime) + 'ms');
  }
  if (opt_asyncTestFailure)
    cleanTestRun = false;
  var done = false;
  if (pendingTearDown) {
    pendingTearDown();
    pendingTearDown = null;
  }
  if (testCases.length > 0) {
    testStartTime = now;
    testName = testCases.pop();
    console.log('TEST ' + testName + ' starting...');
    var isAsyncTest = window[testName].length;
    try {
      if (window.setUp)
        window.setUp();
      pendingTearDown = window.tearDown;
      window[testName](continueTesting);
    } catch (err) {
      console.error('Failure in test ' + testName + '\n' + err);
      console.log(err.stack);
      cleanTestRun = false;
    }
    // Asynchronous tests must manually call continueTesting when complete.
    if (!isAsyncTest)
      continueTesting();
  } else {
    done = true;
    endTests(cleanTestRun);
  }
  if (!done) {
    domAutomationController.send('PENDING');
  }
}
/**
 * Runs the next test in the queue. Reports the test results if the queue is
 * empty.
 * @param {boolean=} opt_asyncTestFailure Optional parameter indicated if the
 *     last asynchronous test failed.
 */
Runs the next test in the queue. Reports the test results if the queue is
empty.
@param {boolean=} opt_asyncTestFailure Optional parameter indicated if the
last asynchronous test failed.
Runs the next test in the queue . Reports the test results if the queue is empty . @param { boolean = } opt_asyncTestFailure Optional parameter indicated if the last asynchronous test failed .
function continueTesting(opt_asyncTestFailure) {
  var now = performance.now();
  if (testName) {
    console.log(
        'TEST ' + testName +
        ' complete, status=' + (opt_asyncTestFailure ? 'FAIL' : 'PASS') +
        ', duration=' + Math.round(now - testStartTime) + 'ms');
  }
  if (opt_asyncTestFailure)
    cleanTestRun = false;
  var done = false;
  if (pendingTearDown) {
    pendingTearDown();
    pendingTearDown = null;
  }
  if (testCases.length > 0) {
    testStartTime = now;
    testName = testCases.pop();
    console.log('TEST ' + testName + ' starting...');
    var isAsyncTest = window[testName].length;
    try {
      if (window.setUp)
        window.setUp();
      pendingTearDown = window.tearDown;
      window[testName](continueTesting);
    } catch (err) {
      console.error('Failure in test ' + testName + '\n' + err);
      console.log(err.stack);
      cleanTestRun = false;
    }
    if (!isAsyncTest)
      continueTesting();
  } else {
    done = true;
    endTests(cleanTestRun);
  }
  if (!done) {
    domAutomationController.send('PENDING');
  }
}
function continueTesting ( opt_asyncTestFailure ) { var now = performance . now ( ) ; if ( testName ) { console . log ( 'TEST ' + testName + ' complete, status=' + ( opt_asyncTestFailure ? 'FAIL' : 'PASS' ) + ', duration=' + Math . round ( now - testStartTime ) + 'ms' ) ; } if ( opt_asyncTestFailure ) cleanTestRun = false ; var done = false ; if ( pendingTearDown ) { pendingTearDown ( ) ; pendingTearDown = null ; } if ( testCases . length > 0 ) { testStartTime = now ; testName = testCases . pop ( ) ; console . log ( 'TEST ' + testName + ' starting...' ) ; var isAsyncTest = window [ testName ] . length ; try { if ( window . setUp ) window . setUp ( ) ; pendingTearDown = window . tearDown ; window [ testName ] ( continueTesting ) ; } catch ( err ) { console . error ( 'Failure in test ' + testName + '\n' + err ) ; console . log ( err . stack ) ; cleanTestRun = false ; } if ( ! isAsyncTest ) continueTesting ( ) ; } else { done = true ; endTests ( cleanTestRun ) ; } if ( ! done ) { domAutomationController . send ( 'PENDING' ) ; } }
Runs the next test in the queue.
Runs the next test in the queue .
// Asynchronous tests must manually call continueTesting when complete.