fix bug TDIS-5981

Below bugs are fixed from this issue:
1. attribute of callback must exist
2. the totalsize of download should be a number not a string
3. In order to pass QA's test, we add some urls from tests set to download
cache
4. reimplement setListener() function
5. The state to cancel can be Downloading or Paused. The root casue
of issue is that it ignore Paused state.