function runTestFunction(
    testFunction, testBody, testArguments, onlyAssertFails) {
  currentTestFunction = testFunction;
  currentTestArguments = testArguments;
  var ok = createExpect(testBody).apply(null, testArguments);
  return testResult(onlyAssertFails && ok);
}
/**
 * This is the guts of WebUIBrowserTest. It runs the test surrounded by an
 * expect to catch Errors. If |errors| is non-empty, it reports a failure and
 * a message by joining |errors|. Consumers can use this to use assert/expect
 * functions asynchronously, but are then responsible for reporting errors to
 * the browser themselves through testDone().
 * @param {string} testFunction The function name to report on failure.
 * @param {Function} testBody The function to call.
 * @param {Array} testArguments The arguments to call |testBody| with.
 * @param {boolean} onlyAssertFails When true, only assertions cause failing
 *     testResult.
 * @return {Array<boolean, string>} [test-succeeded, message-if-failed]
 * @see createExpect
 * @see testResult
 */
This is the guts of WebUIBrowserTest. It runs the test surrounded by an
expect to catch Errors. If |errors| is non-empty, it reports a failure and
a message by joining |errors|. Consumers can use this to use assert/expect
functions asynchronously, but are then responsible for reporting errors to
the browser themselves through testDone().
@param {string} testFunction The function name to report on failure.
@param {Function} testBody The function to call.
@param {Array} testArguments The arguments to call |testBody| with.
@param {boolean} onlyAssertFails When true, only assertions cause failing
testResult.
@return {Array} [test-succeeded, message-if-failed]
@see createExpect
@see testResult
This is the guts of WebUIBrowserTest . It runs the test surrounded by an expect to catch Errors . If |errors| is non - empty it reports a failure and a message by joining |errors| . Consumers can use this to use assert / expect functions asynchronously but are then responsible for reporting errors to the browser themselves through testDone () . @param { string } testFunction The function name to report on failure . @param { Function } testBody The function to call . @param { Array } testArguments The arguments to call |testBody| with . @param { boolean } onlyAssertFails When true only assertions cause failing testResult . @return { Array } [ test - succeeded message - if - failed ] @see createExpect @see testResult
function runTestFunction(
    testFunction, testBody, testArguments, onlyAssertFails) {
  currentTestFunction = testFunction;
  currentTestArguments = testArguments;
  var ok = createExpect(testBody).apply(null, testArguments);
  return testResult(onlyAssertFails && ok);
}
function runTestFunction ( testFunction , testBody , testArguments , onlyAssertFails ) { currentTestFunction = testFunction ; currentTestArguments = testArguments ; var ok = createExpect ( testBody ) . apply ( null , testArguments ) ; return testResult ( onlyAssertFails && ok ) ; }
This is the guts of WebUIBrowserTest.
This is the guts of WebUIBrowserTest .