From 88fd0519ea7276ca4d4931ae28688f0f71460e06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Thu, 29 Jan 2009 12:39:37 +0000 Subject: [PATCH] make it easier to change the delay passed to the delay_call func, test only, no functional change git-svn-id: http://svn.openlayers.org/trunk/openlayers@8778 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- tests/Control/KeyboardDefaults.html | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/Control/KeyboardDefaults.html b/tests/Control/KeyboardDefaults.html index 426608efe1..0f83f47d15 100644 --- a/tests/Control/KeyboardDefaults.html +++ b/tests/Control/KeyboardDefaults.html @@ -47,6 +47,7 @@ map.addControl(control); var STARTING_ZOOM_LEVEL = 4; + var DELAY = 2; var centerLL = new OpenLayers.LonLat(0,0); map.setCenter(centerLL, STARTING_ZOOM_LEVEL); @@ -55,56 +56,56 @@ evt.keyCode = OpenLayers.Event.KEY_LEFT; control.defaultKeyPress(evt); t.delay_call( - 2, function() { + DELAY, function() { t.ok( map.getCenter().lon < centerLL.lon, "key left works correctly" ); // Start new test. evt.keyCode = OpenLayers.Event.KEY_RIGHT; control.defaultKeyPress(evt); }, - 2, function() { + DELAY, function() { t.eq( map.getCenter().lon, centerLL.lon, "key right works correctly" ); // Start new test. evt.keyCode = OpenLayers.Event.KEY_UP; control.defaultKeyPress(evt); }, - 2, function() { + DELAY, function() { t.ok( map.getCenter().lat > centerLL.lat, "key up works correctly" ); // Start new test. evt.keyCode = OpenLayers.Event.KEY_DOWN; control.defaultKeyPress(evt); }, - 2, function() { + DELAY, function() { t.ok( map.getCenter().lat == centerLL.lat, "key down works correctly" ); // Start new test. evt.keyCode = 33; //page up control.defaultKeyPress(evt); }, - 2, function() { + DELAY, function() { t.ok( map.getCenter().lat > centerLL.lat, "key page up works correctly" ); // Start new test. evt.keyCode = 34; //page down control.defaultKeyPress(evt); }, - 2, function() { + DELAY, function() { t.ok( map.getCenter().lat == centerLL.lat, "key page down works correctly" ); // Start new test. evt.keyCode = 35; //end control.defaultKeyPress(evt); }, - 2, function() { + DELAY, function() { t.ok( map.getCenter().lon > centerLL.lon, "key end works correctly" ); // Start new test. evt.keyCode = 36; //home control.defaultKeyPress(evt); }, - 2, function() { + DELAY, function() { t.ok( map.getCenter().lon == centerLL.lon, "key home works correctly"); // Start new test.