Fake the onload event for tests