servo/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemFileHandle-getFile.js

8 lines
418 B
JavaScript

directory_test(async (t, root) => {
const fileContents = 'awesome content';
let handle = await createFileWithContents(t, 'foo.txt', fileContents, /*parent=*/ root);
let file = await handle.getFile();
let slice = file.slice(1, file.size);
let actualContents = await slice.text();
assert_equals(actualContents, fileContents.slice(1, fileContents.length));
}, 'getFile() provides a file that can be sliced');