| 21 | return new Promise(async (resolve, reject) => { |
| 22 | let iid, deltas = {}; |
| 23 | const onDownloadComplete = delta => { |
| 24 | if (iid === undefined) { |
| 25 | deltas[delta.id] = delta; |
| 26 | } else if (delta.id == iid) { |
| 27 | checkDelta(delta); |
| 28 | } |
| 29 | } |
| 30 | chrome.downloads.onChanged.addListener(onDownloadComplete); |
| 31 | function checkDelta(delta) { |
| 32 | if (delta.state && delta.state.current === "complete") { |
nothing calls this directly
no test coverage detected