[OpenLayers-Dev] problem with unittests for animated zooming

Emanuel Schütze emanuel at intevation.de
Thu Mar 8 05:54:48 EST 2007


Hi,

I try to write unittests for my animated zooming code [1] and I get a problem:

I think, the problem is that I want to test asyncronous code, because the 
animations of zooming and panning runs by call "window.setInterval(..)".
So, f.e. the call "map.zoomIn()" doesn't work and the unittest runs fail (good 
example is test_Map.html; you can run it here [2] ).
If I turn the animation off by calling "map.zoomIn(false)" the test is ok!

Now, I tried it with:
map.zoomIn();
t.wait_result ([seconds]) 

and

t.delay_call ([seconds], function(){ map.zoomIn(); }).

But both doesn't work!

Can you help me?

Emanuel


[1] http://dev.openlayers.org/sandbox/emanuel/animatedZooming/
[2] 
http://dev.openlayers.org/sandbox/emanuel/animatedZooming/tests/run-tests.html



More information about the Dev mailing list