feat: add getPercentComplete
/ getCurrentBytesPerSecond
/ getEndTime
to DownloadItem (#42913)
feat: getCurrentSpeed / getPercentComplete / getEndTime on DownloadItem Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Theo Gravity <theo@suteki.nu>
This commit is contained in:
parent
8ed34bf203
commit
d3596f61b6
4 changed files with 46 additions and 1 deletions
|
@ -889,13 +889,21 @@ describe('session module', () => {
|
|||
}
|
||||
});
|
||||
|
||||
const today = Math.floor(Date.now() / 1000);
|
||||
const item = await downloadDone;
|
||||
expect(item.getState()).to.equal('completed');
|
||||
expect(item.getFilename()).to.equal('mock.pdf');
|
||||
expect(item.getMimeType()).to.equal('application/pdf');
|
||||
expect(item.getReceivedBytes()).to.equal(mockPDF.length);
|
||||
expect(item.getTotalBytes()).to.equal(mockPDF.length);
|
||||
expect(item.getPercentComplete()).to.equal(100);
|
||||
expect(item.getCurrentBytesPerSecond()).to.equal(0);
|
||||
expect(item.getContentDisposition()).to.equal(contentDisposition);
|
||||
|
||||
const start = item.getStartTime();
|
||||
const end = item.getEndTime();
|
||||
expect(start).to.be.greaterThan(today);
|
||||
expect(end).to.be.greaterThan(start);
|
||||
});
|
||||
|
||||
it('throws when called with invalid headers', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue