[windmill/windmill] 49c847: Make waits.sleep work in array-type tests.

2 views
Skip to first unread message

nor...@github.com

unread,
Nov 24, 2010, 3:29:05 PM11/24/10
to windmill...@googlegroups.com
Branch: refs/heads/master
Home: https://github.com/windmill/windmill

Commit: 49c84736b1ab7101367cb3923df2ad1b1f77eaa8
https://github.com/windmill/windmill/commit/49c84736b1ab7101367cb3923df2ad1b1f77eaa8
Author: Dan Hipschman <d...@linux.ucla.edu>
Date: 2010-11-24 (Wed, 24 Nov 2010)

Changed paths:
M windmill/html/js/wm/jstest.js

Log Message:
-----------
Make waits.sleep work in array-type tests.

This fixes a bug where waits.sleep doesn't wait in array-type tests.
runSingleTestAction (all this code is in wm/jstest.js) just sets
currentDelay on the _testItemArrayObj when it encounters waits.sleep,
and then returns control to runTestItemArray which increments the item
pointer and should wait the specified time before running the next
test item. This is the relevant code for that:

if (success) {
// Run the next item in the test array
if (!this.waiting){
setTimeout(runNextItemInArray, tests.currentDelay);
}
}
// There was an error in the current test-array item
// abort the entire array and go to the next test
else {
this.runNextTest();
}

The problem is that runSingleTestAction doesn't return true, it
returns undefined:

if (item.method == 'waits.sleep') {
// Array-style -- set the ms for the array loop to
// use in the setTimeout
if (typeof incr != 'undefined') {
tests.currentDelay = item.params.milliseconds;
}
// Single UI action -- do the wait inline right here
else {
setTimeout(function () { _this.runNextTest.call(_this); },
item.params.milliseconds);
return true;
}
}

[ Falls off the end of the function... ]


Reply all
Reply to author
Forward
0 new messages