mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision 332b7c4e711d75ead4c0dfbf7f6f0b683206756d
This commit is contained in:
parent
46611b012e
commit
b60afa18f5
389 changed files with 7767 additions and 2421 deletions
|
@ -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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue