turn example into doc-unittest and fix onProgress callback