| 1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
| 2 |
"http://www.w3.org/TR/html4/strict.dtd"> |
| 3 |
<html> |
| 4 |
<head> |
| 5 |
<title>robot deferred connect tests</title> |
| 6 |
|
| 7 |
<style> |
| 8 |
@import "../../../util/doh/robot/robot.css"; |
| 9 |
</style> |
| 10 |
|
| 11 |
|
| 12 |
<script type="text/javascript" src="../../../dojo/dojo.js" |
| 13 |
data-dojo-config="isDebug: true, async: true"></script> |
| 14 |
|
| 15 |
<script type="text/javascript"> |
| 16 |
require([ |
| 17 |
"doh/runner", "dojo/robotx", "dojo/domReady!" |
| 18 |
], function(doh, robot){ |
| 19 |
robot.initRobot('../_Widget-deferredConnect.html'); |
| 20 |
|
| 21 |
// Test that deferred connections get set up correctly when they need to be |
| 22 |
// (_Widget only does the dojo.connect() for onmousemove if it needs to) |
| 23 |
doh.register("deferredConnect", [ |
| 24 |
{ |
| 25 |
name: "mouse move on widget where onmousemove overridden", |
| 26 |
timeout: 5000, |
| 27 |
runTest: function(){ |
| 28 |
var d = new doh.Deferred(); |
| 29 |
robot.mouseMoveAt("overrode", 500); |
| 30 |
robot.sequence(d.getTestCallback(function(){ |
| 31 |
doh.t(robot.window.overrodeMouseMoved, "overrode button event handler fired"); |
| 32 |
}), 500); |
| 33 |
return d; |
| 34 |
} |
| 35 |
}, |
| 36 |
{ |
| 37 |
name: "mouse move on widget where onmousemove connected", |
| 38 |
timeout: 5000, |
| 39 |
runTest: function(){ |
| 40 |
var d = new doh.Deferred(); |
| 41 |
robot.mouseMoveAt("connect", 500); |
| 42 |
|
| 43 |
robot.sequence(d.getTestCallback(function(){ |
| 44 |
doh.t(robot.window.connectedMouseMoved, "connected button event handler fired"); |
| 45 |
}), 500); |
| 46 |
return d; |
| 47 |
} |
| 48 |
}, |
| 49 |
{ |
| 50 |
name: "mouse move on widget where onmousemove overridden and connected", |
| 51 |
timeout: 5000, |
| 52 |
runTest: function(){ |
| 53 |
var d = new doh.Deferred(); |
| 54 |
robot.mouseMoveAt("both", 500); |
| 55 |
|
| 56 |
robot.sequence(d.getTestCallback(function(){ |
| 57 |
doh.t(robot.window.bothOverrodeMouseMoved, "dojo/method handler fired"); |
| 58 |
doh.t(robot.window.bothConnectedMouseMoved, "dojo/connect handler fired"); |
| 59 |
}), 500); |
| 60 |
return d; |
| 61 |
} |
| 62 |
} |
| 63 |
]); |
| 64 |
|
| 65 |
doh.run(); |
| 66 |
}); |
| 67 |
</script> |
| 68 |
</head> |
| 69 |
</html> |