kripken/emscripten — pull request #986 by caiiiycuk (2013-03-21 14:43:04+00:00)
Title: SDL mouse offsets test

Related with https://github.com/kripken/emscripten/pull/958
Test should pass
```
python tests/runner.py browser.test_sdl_mouse
python tests/runner.py browser.test_sdl_mouse_offsets
```

In test sdl_mouse_offsets i use simulateMouseEvent to send absolute events (i dont add offsets to event) on canvas.
```
emscripten_run_script("window.simulateMouseEvent(10, 20, -1)"); // move from 0,0 to 10,20
emscripten_run_script("window.simulateMouseEvent(10, 20, 0)"); // click
emscripten_run_script("window.simulateMouseEvent(10, 20, 0)"); // click some more, but this one should be ignored through PeepEvent
emscripten_run_script("window.simulateMouseEvent(30, 77, -1)"); // move some more
emscripten_run_script("window.simulateMouseEvent(30, 77, 1)"); // trigger the end
```

All this coordinates are absolute coordinates. Canvas has padding from top left corner on 5px, so if we simulate event 10, 20 in SDL we should have 5, 15.

Right output in textarea:
```
motion: 5,15 5,15
button down: 1,1 5,15
button up: 1,0 5,15
motion: 25,72 20,57
```

This test does not pass on code before my commit.