Add test for some download file cases and adds calls for listener.