Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /FileAPI/file/File-lastModified.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset=utf-8>
<title>File's lastModified</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
"use strict";
promise_test(async t => {
const before = Date.now();
const file = new File([], "dummy");
const after = Date.now();
await t.step_wait(() => Date.now() > after, "The clock advances beyond construction");
assert_between_inclusive(file.lastModified, before, after);
}, "lastModified defaults to the time of construction");
</script>