start testing the drag handler

git-svn-id: http://svn.openlayers.org/trunk/openlayers@3689 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2007-07-10 22:48:33 +00:00
parent 21d97f45f0
commit f7f75bf8c2
2 changed files with 30 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
<html>
<head>
<script src="../../lib/OpenLayers.js"></script>
<script type="text/javascript"><!--
function test_Handler_Drag_constructor(t) {
t.plan(3);
var map = new OpenLayers.Map('map');
var control = new OpenLayers.Control();
control.id = Math.random();
var callbacks = {foo: "bar"};
var options = {bar: "foo"};
map.addControl(control);
OpenLayers.Handler.prototype.initialize = function(con, call, opt) {
t.eq(con.id, control.id,
"constructor calls parent with the correct control");
t.eq(call, callbacks,
"constructor calls parent with the correct callbacks");
t.eq(opt, options,
"constructor calls parent with the correct options");
}
var drag = new OpenLayers.Handler.Drag(control, callbacks, options);
}
// -->
</script>
</head>
<body>
<div id="map" style="width: 300px; height: 150px;"/>
</body>
</html>