Changeset 290998 in webkit


Ignore:
Timestamp:
Mar 8, 2022 10:40:08 AM (4 months ago)
Author:
sihui_liu@apple.com
Message:

File System Access: disallow empty name in FileSystemHandle
https://bugs.webkit.org/show_bug.cgi?id=237563

Reviewed by Youenn Fablet.

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-removeEntry.https.any-expected.txt:
  • web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any.worker-expected.txt:

Source/WebKit:

Updated expectations of imported wpt tests.

  • NetworkProcess/storage/FileSystemStorageHandle.cpp:

(WebKit::isValidFileName):

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r290995 r290998  
     12022-03-08  Sihui Liu  <sihui_liu@apple.com>
     2
     3        File System Access: disallow empty name in FileSystemHandle
     4        https://bugs.webkit.org/show_bug.cgi?id=237563
     5
     6        Reviewed by Youenn Fablet.
     7
     8        * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any-expected.txt:
     9        * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any.worker-expected.txt:
     10        * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any-expected.txt:
     11        * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any.worker-expected.txt:
     12
    1132022-03-08  Alex Christensen  <achristensen@webkit.org>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any-expected.txt

    r290765 r290998  
    55PASS getDirectoryHandle(create=true) returns existing directories without erasing
    66FAIL 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
    7 FAIL getDirectoryHandle() with empty name assert_unreached: Should have rejected: undefined Reached unreachable code
     7PASS getDirectoryHandle() with empty name
    88PASS getDirectoryHandle() with "." name
    99PASS getDirectoryHandle() with ".." name
  • trunk/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any.worker-expected.txt

    r290765 r290998  
    55PASS getDirectoryHandle(create=true) returns existing directories without erasing
    66FAIL 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
    7 FAIL getDirectoryHandle() with empty name assert_unreached: Should have rejected: undefined Reached unreachable code
     7PASS getDirectoryHandle() with empty name
    88PASS getDirectoryHandle() with "." name
    99PASS getDirectoryHandle() with ".." name
  • trunk/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any-expected.txt

    r290765 r290998  
    55FAIL 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
    66FAIL 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)"
    7 FAIL removeEntry() with empty name should fail assert_unreached: Should have rejected: undefined Reached unreachable code
     7PASS removeEntry() with empty name should fail
    88PASS removeEntry() with "." name should fail
    99PASS removeEntry() with ".." name should fail
  • trunk/LayoutTests/imported/w3c/web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any.worker-expected.txt

    r290765 r290998  
    55FAIL 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
    66FAIL 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)"
    7 FAIL removeEntry() with empty name should fail assert_unreached: Should have rejected: undefined Reached unreachable code
     7PASS removeEntry() with empty name should fail
    88PASS removeEntry() with "." name should fail
    99PASS removeEntry() with ".." name should fail
  • trunk/Source/WebKit/ChangeLog

    r290996 r290998  
     12022-03-08  Sihui Liu  <sihui_liu@apple.com>
     2
     3        File System Access: disallow empty name in FileSystemHandle
     4        https://bugs.webkit.org/show_bug.cgi?id=237563
     5
     6        Reviewed by Youenn Fablet.
     7
     8        Updated expectations of imported wpt tests.
     9
     10        * NetworkProcess/storage/FileSystemStorageHandle.cpp:
     11        (WebKit::isValidFileName):
     12
    1132022-03-08  Alex Christensen  <achristensen@webkit.org>
    214
  • trunk/Source/WebKit/NetworkProcess/storage/FileSystemStorageHandle.cpp

    r290765 r290998  
    8585static bool isValidFileName(const String& name)
    8686{
    87     return name != "." && name != ".." && !name.contains(pathSeparator);
     87    return !name.isEmpty() && name != "." && name != ".." && !name.contains(pathSeparator);
    8888}
    8989
Note: See TracChangeset for help on using the changeset viewer.