Title: [290951] branches/safari-613-branch
Revision
290951
Author
[email protected]
Date
2022-03-07 14:11:12 -0800 (Mon, 07 Mar 2022)

Log Message

Cherry-pick r290765. rdar://problem/89232969

    Throw proper exception on failed removeEntry() calls
    https://bugs.webkit.org/show_bug.cgi?id=237382
    <rdar://89232969>

    Reviewed by Chris Dumez.

    LayoutTests/imported/w3c:

    * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any-expected.txt:
    * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any.worker-expected.txt:
    * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getFileHandle.https.any-expected.txt:
    * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getFileHandle.https.any.worker-expected.txt:
    * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any-expected.txt:
    * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any.worker-expected.txt:

    Source/WebKit:

    Updated existing tests.

    * NetworkProcess/storage/FileSystemStorageError.h:
    (WebKit::convertToException):
    * NetworkProcess/storage/FileSystemStorageHandle.cpp:
    (WebKit::FileSystemStorageHandle::removeEntry):

    LayoutTests:

    * storage/filesystemaccess/handle-move-expected.txt:
    * storage/filesystemaccess/handle-move-worker-expected.txt:
    * storage/filesystemaccess/resources/handle-move.js:
    (async test):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290765 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-613-branch/LayoutTests/ChangeLog (290950 => 290951)


--- branches/safari-613-branch/LayoutTests/ChangeLog	2022-03-07 22:11:06 UTC (rev 290950)
+++ branches/safari-613-branch/LayoutTests/ChangeLog	2022-03-07 22:11:12 UTC (rev 290951)
@@ -1,5 +1,56 @@
 2022-03-07  Russell Epstein  <[email protected]>
 
+        Cherry-pick r290765. rdar://problem/89232969
+
+    Throw proper exception on failed removeEntry() calls
+    https://bugs.webkit.org/show_bug.cgi?id=237382
+    <rdar://89232969>
+    
+    Reviewed by Chris Dumez.
+    
+    LayoutTests/imported/w3c:
+    
+    * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any-expected.txt:
+    * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any.worker-expected.txt:
+    * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getFileHandle.https.any-expected.txt:
+    * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getFileHandle.https.any.worker-expected.txt:
+    * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any-expected.txt:
+    * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any.worker-expected.txt:
+    
+    Source/WebKit:
+    
+    Updated existing tests.
+    
+    * NetworkProcess/storage/FileSystemStorageError.h:
+    (WebKit::convertToException):
+    * NetworkProcess/storage/FileSystemStorageHandle.cpp:
+    (WebKit::FileSystemStorageHandle::removeEntry):
+    
+    LayoutTests:
+    
+    * storage/filesystemaccess/handle-move-expected.txt:
+    * storage/filesystemaccess/handle-move-worker-expected.txt:
+    * storage/filesystemaccess/resources/handle-move.js:
+    (async test):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290765 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-03-02  Sihui Liu  <[email protected]>
+
+            Throw proper exception on failed removeEntry() calls
+            https://bugs.webkit.org/show_bug.cgi?id=237382
+            <rdar://89232969>
+
+            Reviewed by Chris Dumez.
+
+            * storage/filesystemaccess/handle-move-expected.txt:
+            * storage/filesystemaccess/handle-move-worker-expected.txt:
+            * storage/filesystemaccess/resources/handle-move.js:
+            (async test):
+
+2022-03-07  Russell Epstein  <[email protected]>
+
         Cherry-pick r290706. rdar://problem/89566459
 
     REGRESSION(r285232) https://alvaromontoro.github.io/almond.css/demo/ looks wrong in Safari, ok in Chrome and Firefox

Modified: branches/safari-613-branch/LayoutTests/imported/w3c/ChangeLog (290950 => 290951)


--- branches/safari-613-branch/LayoutTests/imported/w3c/ChangeLog	2022-03-07 22:11:06 UTC (rev 290950)
+++ branches/safari-613-branch/LayoutTests/imported/w3c/ChangeLog	2022-03-07 22:11:12 UTC (rev 290951)
@@ -1,5 +1,58 @@
 2022-03-07  Russell Epstein  <[email protected]>
 
+        Cherry-pick r290765. rdar://problem/89232969
+
+    Throw proper exception on failed removeEntry() calls
+    https://bugs.webkit.org/show_bug.cgi?id=237382
+    <rdar://89232969>
+    
+    Reviewed by Chris Dumez.
+    
+    LayoutTests/imported/w3c:
+    
+    * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any-expected.txt:
+    * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any.worker-expected.txt:
+    * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getFileHandle.https.any-expected.txt:
+    * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getFileHandle.https.any.worker-expected.txt:
+    * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any-expected.txt:
+    * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any.worker-expected.txt:
+    
+    Source/WebKit:
+    
+    Updated existing tests.
+    
+    * NetworkProcess/storage/FileSystemStorageError.h:
+    (WebKit::convertToException):
+    * NetworkProcess/storage/FileSystemStorageHandle.cpp:
+    (WebKit::FileSystemStorageHandle::removeEntry):
+    
+    LayoutTests:
+    
+    * storage/filesystemaccess/handle-move-expected.txt:
+    * storage/filesystemaccess/handle-move-worker-expected.txt:
+    * storage/filesystemaccess/resources/handle-move.js:
+    (async test):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290765 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-03-02  Sihui Liu  <[email protected]>
+
+            Throw proper exception on failed removeEntry() calls
+            https://bugs.webkit.org/show_bug.cgi?id=237382
+            <rdar://89232969>
+
+            Reviewed by Chris Dumez.
+
+            * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any-expected.txt:
+            * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any.worker-expected.txt:
+            * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getFileHandle.https.any-expected.txt:
+            * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getFileHandle.https.any.worker-expected.txt:
+            * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any-expected.txt:
+            * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any.worker-expected.txt:
+
+2022-03-07  Russell Epstein  <[email protected]>
+
         Cherry-pick r290554. rdar://problem/83757966
 
     Remove Node::deprecatedIsInert

Modified: branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any-expected.txt (290950 => 290951)


--- branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any-expected.txt	2022-03-07 22:11:06 UTC (rev 290950)
+++ branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any-expected.txt	2022-03-07 22:11:12 UTC (rev 290951)
@@ -5,16 +5,8 @@
 PASS getDirectoryHandle(create=true) returns existing directories without erasing
 FAIL getDirectoryHandle() when a file already exists with the same name promise_rejects_dom: function "function () { throw e }" threw object "TypeError: Type error" that is not a DOMException TypeMismatchError: property "code" is equal to undefined, expected 17
 FAIL getDirectoryHandle() with empty name assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL getDirectoryHandle() with "." name promise_rejects_js: function "function () { throw e }" threw object "UnknownError: Name is invalid" ("UnknownError") expected instance of function "function TypeError() {
-    [native code]
-}" ("TypeError")
-FAIL getDirectoryHandle() with ".." name promise_rejects_js: function "function () { throw e }" threw object "UnknownError: Name is invalid" ("UnknownError") expected instance of function "function TypeError() {
-    [native code]
-}" ("TypeError")
-FAIL getDirectoryHandle(create=false) with a path separator when the directory exists promise_rejects_js: getDirectoryHandle() must reject names containing "/" function "function () { throw e }" threw object "UnknownError: Name is invalid" ("UnknownError") expected instance of function "function TypeError() {
-    [native code]
-}" ("TypeError")
-FAIL getDirectoryHandle(create=true) with a path separator promise_rejects_js: getDirectoryHandle(true) must reject names containing "/" function "function () { throw e }" threw object "UnknownError: Name is invalid" ("UnknownError") expected instance of function "function TypeError() {
-    [native code]
-}" ("TypeError")
+PASS getDirectoryHandle() with "." name
+PASS getDirectoryHandle() with ".." name
+PASS getDirectoryHandle(create=false) with a path separator when the directory exists
+PASS getDirectoryHandle(create=true) with a path separator
 

Modified: branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any.worker-expected.txt (290950 => 290951)


--- branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any.worker-expected.txt	2022-03-07 22:11:06 UTC (rev 290950)
+++ branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any.worker-expected.txt	2022-03-07 22:11:12 UTC (rev 290951)
@@ -5,16 +5,8 @@
 PASS getDirectoryHandle(create=true) returns existing directories without erasing
 FAIL getDirectoryHandle() when a file already exists with the same name promise_rejects_dom: function "function () { throw e }" threw object "TypeError: Type error" that is not a DOMException TypeMismatchError: property "code" is equal to undefined, expected 17
 FAIL getDirectoryHandle() with empty name assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL getDirectoryHandle() with "." name promise_rejects_js: function "function () { throw e }" threw object "UnknownError: Name is invalid" ("UnknownError") expected instance of function "function TypeError() {
-    [native code]
-}" ("TypeError")
-FAIL getDirectoryHandle() with ".." name promise_rejects_js: function "function () { throw e }" threw object "UnknownError: Name is invalid" ("UnknownError") expected instance of function "function TypeError() {
-    [native code]
-}" ("TypeError")
-FAIL getDirectoryHandle(create=false) with a path separator when the directory exists promise_rejects_js: getDirectoryHandle() must reject names containing "/" function "function () { throw e }" threw object "UnknownError: Name is invalid" ("UnknownError") expected instance of function "function TypeError() {
-    [native code]
-}" ("TypeError")
-FAIL getDirectoryHandle(create=true) with a path separator promise_rejects_js: getDirectoryHandle(true) must reject names containing "/" function "function () { throw e }" threw object "UnknownError: Name is invalid" ("UnknownError") expected instance of function "function TypeError() {
-    [native code]
-}" ("TypeError")
+PASS getDirectoryHandle() with "." name
+PASS getDirectoryHandle() with ".." name
+PASS getDirectoryHandle(create=false) with a path separator when the directory exists
+PASS getDirectoryHandle(create=true) with a path separator
 

Modified: branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getFileHandle.https.any-expected.txt (290950 => 290951)


--- branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getFileHandle.https.any-expected.txt	2022-03-07 22:11:06 UTC (rev 290950)
+++ branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getFileHandle.https.any-expected.txt	2022-03-07 22:11:12 UTC (rev 290951)
@@ -6,16 +6,8 @@
 FAIL getFileHandle(create=false) when a directory already exists with the same name promise_rejects_dom: function "function () { throw e }" threw object "TypeError: Type error" that is not a DOMException TypeMismatchError: property "code" is equal to undefined, expected 17
 FAIL getFileHandle(create=true) when a directory already exists with the same name promise_rejects_dom: function "function () { throw e }" threw object "TypeError: Type error" that is not a DOMException TypeMismatchError: property "code" is equal to undefined, expected 17
 PASS getFileHandle() with empty name
-FAIL getFileHandle() with "." name promise_rejects_js: function "function () { throw e }" threw object "UnknownError: Name is invalid" ("UnknownError") expected instance of function "function TypeError() {
-    [native code]
-}" ("TypeError")
-FAIL getFileHandle() with ".." name promise_rejects_js: function "function () { throw e }" threw object "UnknownError: Name is invalid" ("UnknownError") expected instance of function "function TypeError() {
-    [native code]
-}" ("TypeError")
-FAIL getFileHandle(create=false) with a path separator when the file exists. promise_rejects_js: getFileHandle() must reject names containing "/" function "function () { throw e }" threw object "UnknownError: Name is invalid" ("UnknownError") expected instance of function "function TypeError() {
-    [native code]
-}" ("TypeError")
-FAIL getFileHandle(create=true) with a path separator promise_rejects_js: getFileHandle(create=true) must reject names containing "/" function "function () { throw e }" threw object "UnknownError: Name is invalid" ("UnknownError") expected instance of function "function TypeError() {
-    [native code]
-}" ("TypeError")
+PASS getFileHandle() with "." name
+PASS getFileHandle() with ".." name
+PASS getFileHandle(create=false) with a path separator when the file exists.
+PASS getFileHandle(create=true) with a path separator
 

Modified: branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getFileHandle.https.any.worker-expected.txt (290950 => 290951)


--- branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getFileHandle.https.any.worker-expected.txt	2022-03-07 22:11:06 UTC (rev 290950)
+++ branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getFileHandle.https.any.worker-expected.txt	2022-03-07 22:11:12 UTC (rev 290951)
@@ -6,16 +6,8 @@
 FAIL getFileHandle(create=false) when a directory already exists with the same name promise_rejects_dom: function "function () { throw e }" threw object "TypeError: Type error" that is not a DOMException TypeMismatchError: property "code" is equal to undefined, expected 17
 FAIL getFileHandle(create=true) when a directory already exists with the same name promise_rejects_dom: function "function () { throw e }" threw object "TypeError: Type error" that is not a DOMException TypeMismatchError: property "code" is equal to undefined, expected 17
 PASS getFileHandle() with empty name
-FAIL getFileHandle() with "." name promise_rejects_js: function "function () { throw e }" threw object "UnknownError: Name is invalid" ("UnknownError") expected instance of function "function TypeError() {
-    [native code]
-}" ("TypeError")
-FAIL getFileHandle() with ".." name promise_rejects_js: function "function () { throw e }" threw object "UnknownError: Name is invalid" ("UnknownError") expected instance of function "function TypeError() {
-    [native code]
-}" ("TypeError")
-FAIL getFileHandle(create=false) with a path separator when the file exists. promise_rejects_js: getFileHandle() must reject names containing "/" function "function () { throw e }" threw object "UnknownError: Name is invalid" ("UnknownError") expected instance of function "function TypeError() {
-    [native code]
-}" ("TypeError")
-FAIL getFileHandle(create=true) with a path separator promise_rejects_js: getFileHandle(create=true) must reject names containing "/" function "function () { throw e }" threw object "UnknownError: Name is invalid" ("UnknownError") expected instance of function "function TypeError() {
-    [native code]
-}" ("TypeError")
+PASS getFileHandle() with "." name
+PASS getFileHandle() with ".." name
+PASS getFileHandle(create=false) with a path separator when the file exists.
+PASS getFileHandle(create=true) with a path separator
 

Modified: branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any-expected.txt (290950 => 290951)


--- branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any-expected.txt	2022-03-07 22:11:06 UTC (rev 290950)
+++ branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any-expected.txt	2022-03-07 22:11:12 UTC (rev 290951)
@@ -5,11 +5,7 @@
 FAIL removeEntry() on a non-empty directory should fail promise_rejects_dom: function "function () { throw e }" threw object "UnknownError: The operation failed for an unknown transient reason (e.g. out of memory)." that is not a DOMException InvalidModificationError: property "code" is equal to 0, expected 13
 FAIL removeEntry() on a directory recursively should delete all sub-items promise_test: Unhandled rejection with value: object "TypeError: handle.createWritable is not a function. (In 'handle.createWritable()', 'handle.createWritable' is undefined)"
 FAIL removeEntry() with empty name should fail assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL removeEntry() with "." name should fail promise_rejects_js: function "function () { throw e }" threw object "UnknownError: The operation failed for an unknown transient reason (e.g. out of memory)." ("UnknownError") expected instance of function "function TypeError() {
-    [native code]
-}" ("TypeError")
-FAIL removeEntry() with ".." name should fail promise_rejects_js: function "function () { throw e }" threw object "UnknownError: The operation failed for an unknown transient reason (e.g. out of memory)." ("UnknownError") expected instance of function "function TypeError() {
-    [native code]
-}" ("TypeError")
-FAIL removeEntry() with a path separator should fail. assert_unreached: Should have rejected: removeEntry() must reject names containing "/" Reached unreachable code
+PASS removeEntry() with "." name should fail
+PASS removeEntry() with ".." name should fail
+PASS removeEntry() with a path separator should fail.
 

Modified: branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any.worker-expected.txt (290950 => 290951)


--- branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any.worker-expected.txt	2022-03-07 22:11:06 UTC (rev 290950)
+++ branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any.worker-expected.txt	2022-03-07 22:11:12 UTC (rev 290951)
@@ -5,11 +5,7 @@
 FAIL removeEntry() on a non-empty directory should fail promise_rejects_dom: function "function () { throw e }" threw object "UnknownError: The operation failed for an unknown transient reason (e.g. out of memory)." that is not a DOMException InvalidModificationError: property "code" is equal to 0, expected 13
 FAIL removeEntry() on a directory recursively should delete all sub-items promise_test: Unhandled rejection with value: object "TypeError: handle.createWritable is not a function. (In 'handle.createWritable()', 'handle.createWritable' is undefined)"
 FAIL removeEntry() with empty name should fail assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL removeEntry() with "." name should fail promise_rejects_js: function "function () { throw e }" threw object "UnknownError: The operation failed for an unknown transient reason (e.g. out of memory)." ("UnknownError") expected instance of function "function TypeError() {
-    [native code]
-}" ("TypeError")
-FAIL removeEntry() with ".." name should fail promise_rejects_js: function "function () { throw e }" threw object "UnknownError: The operation failed for an unknown transient reason (e.g. out of memory)." ("UnknownError") expected instance of function "function TypeError() {
-    [native code]
-}" ("TypeError")
-FAIL removeEntry() with a path separator should fail. assert_unreached: Should have rejected: removeEntry() must reject names containing "/" Reached unreachable code
+PASS removeEntry() with "." name should fail
+PASS removeEntry() with ".." name should fail
+PASS removeEntry() with a path separator should fail.
 

Modified: branches/safari-613-branch/LayoutTests/storage/filesystemaccess/handle-move-expected.txt (290950 => 290951)


--- branches/safari-613-branch/LayoutTests/storage/filesystemaccess/handle-move-expected.txt	2022-03-07 22:11:06 UTC (rev 290950)
+++ branches/safari-613-branch/LayoutTests/storage/filesystemaccess/handle-move-expected.txt	2022-03-07 22:11:12 UTC (rev 290951)
@@ -14,8 +14,8 @@
 Test move to a destination with existing file:
 PASS moveFileError.toString() is "UnknownError: The operation failed for an unknown transient reason (e.g. out of memory)."
 Test move with an invalid name:
-PASS moveFileError.toString() is "UnknownError: Name is invalid"
-PASS moveFileError.toString() is "UnknownError: Name is invalid"
+PASS moveFileError.toString() is "TypeError: Name is invalid"
+PASS moveFileError.toString() is "TypeError: Name is invalid"
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: branches/safari-613-branch/LayoutTests/storage/filesystemaccess/handle-move-worker-expected.txt (290950 => 290951)


--- branches/safari-613-branch/LayoutTests/storage/filesystemaccess/handle-move-worker-expected.txt	2022-03-07 22:11:06 UTC (rev 290950)
+++ branches/safari-613-branch/LayoutTests/storage/filesystemaccess/handle-move-worker-expected.txt	2022-03-07 22:11:12 UTC (rev 290951)
@@ -15,8 +15,8 @@
 [Worker] Test move to a destination with existing file:
 PASS [Worker] moveFileError.toString() is "UnknownError: The operation failed for an unknown transient reason (e.g. out of memory)."
 [Worker] Test move with an invalid name:
-PASS [Worker] moveFileError.toString() is "UnknownError: Name is invalid"
-PASS [Worker] moveFileError.toString() is "UnknownError: Name is invalid"
+PASS [Worker] moveFileError.toString() is "TypeError: Name is invalid"
+PASS [Worker] moveFileError.toString() is "TypeError: Name is invalid"
 [Worker] Test move with open access handle:
 PASS [Worker] moveFileError.toString() is "InvalidStateError: Some AccessHandle is active"
 PASS successfullyParsed is true

Modified: branches/safari-613-branch/LayoutTests/storage/filesystemaccess/resources/handle-move.js (290950 => 290951)


--- branches/safari-613-branch/LayoutTests/storage/filesystemaccess/resources/handle-move.js	2022-03-07 22:11:06 UTC (rev 290950)
+++ branches/safari-613-branch/LayoutTests/storage/filesystemaccess/resources/handle-move.js	2022-03-07 22:11:12 UTC (rev 290951)
@@ -72,7 +72,7 @@
             testError =  "Moved file to dirHandle1 with invalid name unexpectedly";
         }, (error) => {
             moveFileError = error;
-            shouldBeEqualToString("moveFileError.toString()", "UnknownError: Name is invalid");
+            shouldBeEqualToString("moveFileError.toString()", "TypeError: Name is invalid");
         });
 
         if (testError) {
@@ -83,7 +83,7 @@
             testError =  "Moved file to dirHandle1 with invalid name unexpectedly";
         }, (error) => {
             moveFileError = error;
-            shouldBeEqualToString("moveFileError.toString()", "UnknownError: Name is invalid");
+            shouldBeEqualToString("moveFileError.toString()", "TypeError: Name is invalid");
         });
 
         if (testError) {

Modified: branches/safari-613-branch/Source/WebKit/ChangeLog (290950 => 290951)


--- branches/safari-613-branch/Source/WebKit/ChangeLog	2022-03-07 22:11:06 UTC (rev 290950)
+++ branches/safari-613-branch/Source/WebKit/ChangeLog	2022-03-07 22:11:12 UTC (rev 290951)
@@ -1,5 +1,58 @@
 2022-03-07  Russell Epstein  <[email protected]>
 
+        Cherry-pick r290765. rdar://problem/89232969
+
+    Throw proper exception on failed removeEntry() calls
+    https://bugs.webkit.org/show_bug.cgi?id=237382
+    <rdar://89232969>
+    
+    Reviewed by Chris Dumez.
+    
+    LayoutTests/imported/w3c:
+    
+    * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any-expected.txt:
+    * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any.worker-expected.txt:
+    * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getFileHandle.https.any-expected.txt:
+    * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getFileHandle.https.any.worker-expected.txt:
+    * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any-expected.txt:
+    * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any.worker-expected.txt:
+    
+    Source/WebKit:
+    
+    Updated existing tests.
+    
+    * NetworkProcess/storage/FileSystemStorageError.h:
+    (WebKit::convertToException):
+    * NetworkProcess/storage/FileSystemStorageHandle.cpp:
+    (WebKit::FileSystemStorageHandle::removeEntry):
+    
+    LayoutTests:
+    
+    * storage/filesystemaccess/handle-move-expected.txt:
+    * storage/filesystemaccess/handle-move-worker-expected.txt:
+    * storage/filesystemaccess/resources/handle-move.js:
+    (async test):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290765 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-03-02  Sihui Liu  <[email protected]>
+
+            Throw proper exception on failed removeEntry() calls
+            https://bugs.webkit.org/show_bug.cgi?id=237382
+            <rdar://89232969>
+
+            Reviewed by Chris Dumez.
+
+            Updated existing tests.
+
+            * NetworkProcess/storage/FileSystemStorageError.h:
+            (WebKit::convertToException):
+            * NetworkProcess/storage/FileSystemStorageHandle.cpp:
+            (WebKit::FileSystemStorageHandle::removeEntry):
+
+2022-03-07  Russell Epstein  <[email protected]>
+
         Cherry-pick r290758. rdar://problem/89710486
 
     [AppSSO] Correct logging messages to avoid confusing screeners that an error has occurred

Modified: branches/safari-613-branch/Source/WebKit/NetworkProcess/storage/FileSystemStorageError.h (290950 => 290951)


--- branches/safari-613-branch/Source/WebKit/NetworkProcess/storage/FileSystemStorageError.h	2022-03-07 22:11:06 UTC (rev 290950)
+++ branches/safari-613-branch/Source/WebKit/NetworkProcess/storage/FileSystemStorageError.h	2022-03-07 22:11:12 UTC (rev 290951)
@@ -53,7 +53,7 @@
     case FileSystemStorageError::InvalidModification:
         return WebCore::Exception { WebCore::InvalidModificationError };
     case FileSystemStorageError::InvalidName:
-        return WebCore::Exception { WebCore::UnknownError, "Name is invalid"_s };
+        return WebCore::Exception { WebCore::TypeError, "Name is invalid"_s };
     case FileSystemStorageError::InvalidState:
         return WebCore::Exception { WebCore::InvalidStateError };
     case FileSystemStorageError::TypeMismatch:

Modified: branches/safari-613-branch/Source/WebKit/NetworkProcess/storage/FileSystemStorageHandle.cpp (290950 => 290951)


--- branches/safari-613-branch/Source/WebKit/NetworkProcess/storage/FileSystemStorageHandle.cpp	2022-03-07 22:11:06 UTC (rev 290950)
+++ branches/safari-613-branch/Source/WebKit/NetworkProcess/storage/FileSystemStorageHandle.cpp	2022-03-07 22:11:12 UTC (rev 290951)
@@ -118,7 +118,13 @@
     if (m_type != Type::Directory)
         return FileSystemStorageError::TypeMismatch;
 
+    if (!isValidFileName(name))
+        return FileSystemStorageError::InvalidName;
+
     auto path = FileSystem::pathByAppendingComponent(m_path, name);
+    if (!FileSystem::fileExists(path))
+        return FileSystemStorageError::FileNotFound;
+
     auto type = FileSystem::fileType(path);
     if (!type)
         return FileSystemStorageError::TypeMismatch;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to