[Pkg-javascript-commits] [dojo] 21/28: Refactor robot so startRobot() is implemented as an asynchronous test fixture, rather than monkey patching doh.run(). This design makes better code separation between vanilla DOH and robot.

David Prévot taffit at moszumanska.debian.org
Thu Aug 21 17:39:48 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag 1.8.6
in repository dojo.

commit c52544a0e0ede89178bb3393cb4e737baf0026ca
Author: Bill Keese <bill at dojotoolkit.org>
Date:   Thu Nov 29 06:42:27 2012 +0000

    Refactor robot so startRobot() is implemented as an asynchronous test fixture, rather than monkey patching doh.run().  This design makes better code separation between vanilla DOH and robot.
    
    Refs #16386 !strict.
    
    git-svn-id: http://svn.dojotoolkit.org/src/dojo/trunk@30074 560b804f-0ae3-0310-86f3-f6aa0a117693
    (cherry picked from commit 28f564e8186eb26efc4f99746ac1d0c7d3038bb0)
---
 robotx.js | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/robotx.js b/robotx.js
index a098636..c376a88 100644
--- a/robotx.js
+++ b/robotx.js
@@ -90,12 +90,12 @@ function onIframeLoad(){
 		iframe.contentWindow.require(["dojo/ready"], function(ready){
 			ready(Infinity, function(){
 				setTimeout(function(){
-					urlLoaded.callback(true);
+					urlLoaded.resolve(true);
 				}, 500);	// 500ms fudge factor; otherwise focus doesn't work on IE8, see ValidationTextBox.js, TimeTextBox.js, etc.
 			});
 		});
 	}else{
-		urlLoaded.callback(true);
+		urlLoaded.resolve(true);
 	}
 }
 
@@ -130,20 +130,14 @@ lang.mixin(robot, {
 		//		URL to open. Any of the test's dojo.doc calls (e.g. dojo.byId()), and any dijit.registry calls
 		//		(e.g. dijit.byId()) will point to elements and widgets inside this application.
 
-		doh.registerGroup("initRobot", {
+		doh.registerGroup("initialize robot", {
 			name: "load " + url,
 			timeout: 100000,	// could take more than 10s so setting to 100s
 			runTest: function(){
 				// Setup module level urlLoaded Deferred that will be resolved by onIframeLoad(), after the iframe
 				// has finished loading
 				urlLoaded = new doh.Deferred();
-
-				// Wait for keyboard to be ready to prevent race conditions between iframe loading and robot init.
-				// If iframe is allowed to load while the robot is typing, sync XHRs can prevent the robot from
-				// completing its initialization.
-				robot._keyboardReady.then(function(){
-					attachIframe(url);
-				});
+				attachIframe(url);
 
 				return urlLoaded;
 			}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git



More information about the Pkg-javascript-commits mailing list