Update web-platform-tests to revision 332b7c4e711d75ead4c0dfbf7f6f0b683206756d

This commit is contained in:
WPT Sync Bot 2019-09-25 10:24:05 +00:00
parent 46611b012e
commit b60afa18f5
389 changed files with 7767 additions and 2421 deletions

View file

@ -0,0 +1,25 @@
// This file defines a directory_test() function that can be used to define
// tests that require a FileSystemDirectoryHandle. The implementation of that
// function in this file will return an empty directory in the sandboxed file
// system.
//
// Another implementation of this function exists in native-fs-test-helpers.js,
// where that version uses the native file system instead.
async function cleanupSandboxedFileSystem() {
const dir =
await FileSystemDirectoryHandle.getSystemDirectory({type: 'sandbox'});
for await (let entry of dir.getEntries())
await dir.removeEntry(entry.name, {recursive: entry.isDirectory});
}
function directory_test(func, description) {
promise_test(async t => {
// To be extra resilient against bad tests, cleanup before every test.
await cleanupSandboxedFileSystem();
const dir =
await FileSystemDirectoryHandle.getSystemDirectory({type: 'sandbox'});
await func(t, dir);
}, description);
}