Implement FileSystemFileEntry.file()
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 3 Sep 2017 04:02:05 +0000 (04:02 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 3 Sep 2017 04:02:05 +0000 (04:02 +0000)
commit1c42a991e4d415fcb4bde02ff98085ac370a8416
treef21d79f8cff069f593d39b9628c682c0c3812b56
parent0ba253ddb39b565cf8b9a132abfd31a3c5696a2a
Implement FileSystemFileEntry.file()
https://bugs.webkit.org/show_bug.cgi?id=176166
<rdar://problem/34187756>

Reviewed by Sam Weinig.

Source/WebCore:

Implement FileSystemFileEntry.file():
- https://wicg.github.io/entries-api/#dom-filesystemfileentry-file

Test: editing/pasteboard/datatransfer-items-drop-fileEntry-file.html

* Modules/entriesapi/DOMFileSystem.cpp:
(WebCore::validatePathIsExpectedType):
(WebCore::DOMFileSystem::listDirectory):
(WebCore::DOMFileSystem::getParent):
(WebCore::DOMFileSystem::getFile):
* Modules/entriesapi/DOMFileSystem.h:
* Modules/entriesapi/FileSystemFileEntry.cpp:
(WebCore::FileSystemFileEntry::file):

LayoutTests:

Add layout test coverage. I have verified that this test passes in Chrome as well.

* editing/pasteboard/datatransfer-items-drop-fileEntry-file-expected.txt: Added.
* editing/pasteboard/datatransfer-items-drop-fileEntry-file.html: Added.
* platform/wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221544 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/datatransfer-items-drop-fileEntry-file-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/datatransfer-items-drop-fileEntry-file.html [new file with mode: 0644]
LayoutTests/platform/wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/Modules/entriesapi/DOMFileSystem.cpp
Source/WebCore/Modules/entriesapi/DOMFileSystem.h
Source/WebCore/Modules/entriesapi/FileSystemFileEntry.cpp
Source/WebCore/Modules/entriesapi/FileSystemFileEntry.h
Source/WebCore/Modules/entriesapi/FileSystemFileEntry.idl