adds tests for the eventgenerator

... and fixes one issue in this utility.

With this test, a Chromium bug was met: https://code.google.com/p/chromium/issues/detail?id=120494
To be kept in mind for future test writing!