75 lines
2.1 KiB
HTML
75 lines
2.1 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
|
"http://www.w3.org/TR/html4/strict.dtd">
|
|
<html>
|
|
<head>
|
|
<title>doh.robot deferred connect tests</title>
|
|
|
|
<style>
|
|
@import "../../../util/doh/robot/robot.css";
|
|
</style>
|
|
|
|
<!-- required: dojo.js -->
|
|
<script type="text/javascript" src="../../../dojo/dojo.js"
|
|
djConfig="isDebug: true"></script>
|
|
|
|
<!-- functions to help test -->
|
|
<script type="text/javascript" src="../helpers.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
dojo.require("dijit.robotx");
|
|
|
|
dojo.ready(function(){
|
|
|
|
doh.robot.initRobot('../_Widget-deferredConnect.html');
|
|
|
|
// Test that deferred connections get set up correctly when they need to be
|
|
// (_Widget only does the dojo.connect() for onmousemove if it needs to)
|
|
doh.register("deferredConnect",
|
|
[
|
|
{
|
|
name: "mouse move on widget where onmousemove overridden",
|
|
timeout: 5000,
|
|
runTest: function(){
|
|
var d = new doh.Deferred();
|
|
doh.robot.mouseMoveAt("overrode", 500);
|
|
doh.robot.sequence(d.getTestCallback(function(){
|
|
doh.t(dojo.global.overrodeMouseMoved, "overrode button event handler fired");
|
|
}), 500);
|
|
return d;
|
|
}
|
|
},
|
|
{
|
|
name: "mouse move on widget where onmousemove connected",
|
|
timeout: 5000,
|
|
runTest: function(){
|
|
var d = new doh.Deferred();
|
|
doh.robot.mouseMoveAt("connect", 500);
|
|
|
|
doh.robot.sequence(d.getTestCallback(function(){
|
|
doh.t(dojo.global.connectedMouseMoved, "connected button event handler fired");
|
|
}), 500);
|
|
return d;
|
|
}
|
|
},
|
|
{
|
|
name: "mouse move on widget where onmousemove overridden and connected",
|
|
timeout: 5000,
|
|
runTest: function(){
|
|
var d = new doh.Deferred();
|
|
doh.robot.mouseMoveAt("both", 500);
|
|
|
|
doh.robot.sequence(d.getTestCallback(function(){
|
|
doh.t(dojo.global.bothOverrodeMouseMoved, "dojo/method handler fired");
|
|
doh.t(dojo.global.bothConnectedMouseMoved, "dojo/connect handler fired");
|
|
}), 500);
|
|
return d;
|
|
}
|
|
}
|
|
]);
|
|
|
|
doh.run();
|
|
});
|
|
</script>
|
|
</head>
|
|
</html>
|