From 547bc1cad0441393d513ca5d549b5fae5898c4ce Mon Sep 17 00:00:00 2001 From: Austin Sullivan Date: Tue, 14 Sep 2021 09:45:22 +0000 Subject: [PATCH] Bug 1728388 [wpt PR 30261] - FS: Add check for removal of sandbox root dir, a=testonly Automatic update from web-platform-tests FS: Add check for removal of sandbox root dir The FileSystemHandle::Remove() method was recently added to allow for the removal of files and directories from the underlying file system. This method now fails when attempting to delete the root of a sandbox file system. Bug: 1242231 Change-Id: Ibe3ed59b79678ce168d0803c6607abd8ac06594c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3123735 Commit-Queue: Austin Sullivan Reviewed-by: Marijn Kruisselbrink Cr-Commit-Position: refs/heads/main@{#917845} -- wpt-commits: ea05faa7f5b21494fbf0b840267d8ccc3e3229d9 wpt-pr: 30261 --- .../sandboxed_FileSystemBaseHandle-remove.https.any.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/testing/web-platform/tests/file-system-access/sandboxed_FileSystemBaseHandle-remove.https.any.js b/testing/web-platform/tests/file-system-access/sandboxed_FileSystemBaseHandle-remove.https.any.js index c3c1776784ef..64aa0bb126fd 100644 --- a/testing/web-platform/tests/file-system-access/sandboxed_FileSystemBaseHandle-remove.https.any.js +++ b/testing/web-platform/tests/file-system-access/sandboxed_FileSystemBaseHandle-remove.https.any.js @@ -1,3 +1,7 @@ // META: script=resources/test-helpers.js // META: script=resources/sandboxed-fs-test-helpers.js // META: script=script-tests/FileSystemBaseHandle-remove.js + +directory_test(async (t, root) => { + await promise_rejects_dom(t, 'InvalidStateError', root.remove()); +}, 'cannot remove the root of a sandbox file system'); -- 2.11.4.GIT