problem with unittests for animated zooming

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

problem with unittests for animated zooming

Emanuel Schütze
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
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev