2023-01-02 16:00:42 -05:00
|
|
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
2021-11-23 11:45:18 -05:00
|
|
|
import { assertEquals } from "./test_util.ts";
|
2020-08-11 08:00:53 -04:00
|
|
|
|
2021-11-23 11:45:18 -05:00
|
|
|
Deno.test(function progressEventConstruct() {
|
2020-08-11 08:00:53 -04:00
|
|
|
const progressEventDefs = new ProgressEvent("progressEventType", {});
|
|
|
|
assertEquals(progressEventDefs.lengthComputable, false);
|
|
|
|
assertEquals(progressEventDefs.loaded, 0);
|
|
|
|
assertEquals(progressEventDefs.total, 0);
|
|
|
|
|
|
|
|
const progressEvent = new ProgressEvent("progressEventType", {
|
|
|
|
lengthComputable: true,
|
|
|
|
loaded: 123,
|
|
|
|
total: 456,
|
|
|
|
});
|
|
|
|
assertEquals(progressEvent.lengthComputable, true);
|
|
|
|
assertEquals(progressEvent.loaded, 123);
|
|
|
|
assertEquals(progressEvent.total, 456);
|
|
|
|
});
|