Add unit tests for unload event handler.