Skip to content

Commit

Permalink
Sync javascript between projects.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Dionne committed Jun 5, 2013
1 parent 170a475 commit 2d61dbe
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ jstestdriver.utils.serializeObjectToArray =
var out = opt_out || out;
if (jstestdriver.utils.isNative(obj, 'Array')) {
out.push('[');
var arr = obj;
var arr = /** @type {Array.<Object>} */ (obj);
for ( var i = 0; i < arr.length; i++) {
this.serializeObjectToArray(arr[i], out);
if (i < arr.length - 1) {
Expand Down
22 changes: 11 additions & 11 deletions JsTestDriver/src/com/google/jstestdriver/javascript/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@ jstestdriver.config = (function(module) {
stylesheetLoader,
jstestdriver.now);
var testRunnerPlugin =
new jstestdriver.plugins.TestRunnerPlugin(
Date,
function() {
jstestdriver.log(jstestdriver.jQuery('body')[0].innerHTML);
jstestdriver.jQuery('body').children().remove();
jstestdriver.jQuery(document).unbind();
jstestdriver.jQuery(document).die();
},
jstestdriver.pluginRegistrar,
jstestdriver.utils.serializeErrors,
runTestLoop);
new jstestdriver.plugins.TestRunnerPlugin(
Date,
function() {
jstestdriver.log(jstestdriver.jQuery('body')[0].innerHTML);
jstestdriver.jQuery('body').children().remove();
jstestdriver.jQuery(document).unbind();
jstestdriver.jQuery(document).die();
},
jstestdriver.pluginRegistrar,
jstestdriver.utils.serializeErrors,
runTestLoop);

jstestdriver.pluginRegistrar.register(
new jstestdriver.plugins.DefaultPlugin(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ jstestdriver.plugins.async.AsyncTestRunnerPlugin.prototype.execute_ = function(
onStageComplete, invokeMethod) {
var runner = this;
var onError = function(error) {runner.errors_.push(error);};
var arguments = this.testRunConfiguration_.getArguments();
var argument = arguments ? arguments[this.testName_] : null;
var args = this.testRunConfiguration_.getArguments();
var argument = args ? args[this.testName_] : null;
var stage = new jstestdriver.plugins.async.TestStage.Builder().
setOnError(onError).
setOnStageComplete(onStageComplete).
Expand Down Expand Up @@ -261,8 +261,8 @@ jstestdriver.plugins.async.AsyncTestRunnerPlugin.prototype.buildResult = functio
jstestdriver.assertCount +
"' encountered.")]);
}
var arguments = this.testRunConfiguration_.getArguments();
var argument = arguments ? arguments[this.testName_] : null;
var args = this.testRunConfiguration_.getArguments();
var argument = args ? args[this.testName_] : null;
return new jstestdriver.TestResult(
this.testCaseInfo_.getTestCaseName(), this.testName_, result, message,
jstestdriver.console.getAndResetLog(), end - this.start_, null, argument);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ goog.provide('jstestdriver.plugins.TestRunnerPlugin');
* @constructor
*/
jstestdriver.plugins.TestRunnerPlugin = function(dateObj,
clearBody,
pluginRegistrar,
serializeErrors,
opt_runTestLoop) {
clearBody,
pluginRegistrar,
serializeErrors,
opt_runTestLoop) {
this.dateObj_ = dateObj;
this.clearBody_ = clearBody;
this.boundRunTest_ = jstestdriver.bind(this, this.runTest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ jstestdriver.plugins.async.CallbackPoolDelegate.prototype.addErrback = function(
* @param {string=} opt_description The callback description.
* @return {Function} The wrapped callback.
* @export
* @deprecated Use addCallback().
*/
jstestdriver.plugins.async.CallbackPoolDelegate.prototype.add =
jstestdriver.plugins.async.CallbackPoolDelegate.prototype.addCallback;
Expand All @@ -101,6 +102,7 @@ jstestdriver.plugins.async.CallbackPoolDelegate.prototype.add =
* @param {string=} opt_description The description.
* @return {Function} A noop callback.
* @export
* @deprecated Use wait().
*/
jstestdriver.plugins.async.CallbackPoolDelegate.prototype.noop = function(
opt_n, opt_timeout, opt_description) {
Expand All @@ -113,3 +115,12 @@ jstestdriver.plugins.async.CallbackPoolDelegate.prototype.noop = function(
return this.pool_.addCallback(
jstestdriver.EMPTY_FUNC, opt_n, opt_timeout, opt_description);
};


/**
* Adds an empty callback to the queue.
* @return {Function} The callback.
* @export
*/
jstestdriver.plugins.async.CallbackPoolDelegate.prototype.wait =
jstestdriver.plugins.async.CallbackPoolDelegate.prototype.noop;

0 comments on commit 2d61dbe

Please sign in to comment.