Test case for addListener.