Bug 311436

Summary: Directory path is incorrect in http/tests/security/file-system-access-via-dataTransfer.html
Product: WebKit Reporter: Anthony Tarbinian <a.tarbinian>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Anthony Tarbinian
Reported 2026-04-03 13:08:58 PDT
In http/tests/security/file-system-access-via-dataTransfer.html , the targetDirectory variable doesn't have the path of a valid directory. This is what the code looks like: ``` let path = location.pathname.split("/"); let filename = path[path.length - 1]; let targetFileName = internals.createTemporaryFile(`${filename}`, ""); let targetDirectory = targetFileName.substring(0, targetFileName.length - filename); ``` Note that targetDirectory is created by taking the substring of targetFileName, however the end of the substring is calculated by doing `targetFileName.length - filename` where filename is a string, not a number. This should be `filename.length` instead. However even when making that change, the targetDirectory still isn't quite right. See the following logs: ``` path: ["","security","file-system-access-via-dataTransfer.html"] filename: file-system-access-via-dataTransfer.html targetFileName: /var/folders/gt/fcd9q4nn66bbk9l0jq5bj6sw0000gn/T/WebKitTestRunners-w8rnouln/WebCoreTesting-file-system-access-via-dataTransfer.htmlnc3lIz targetDirectory: /var/folders/gt/fcd9q4nn66bbk9l0jq5bj6sw0000gn/T/WebKitTestRunners-w8rnouln/WebCoreTesting-file-s ``` Note how targetDirectory has some trailing characters of "WebCoreTesting-file-s" after the directory path. It seems like `internals.createTemporaryFile` is padding some extra characters onto the original filename.
Attachments
Radar WebKit Bug Importer
Comment 1 2026-04-03 13:09:04 PDT
Anthony Tarbinian
Comment 2 2026-04-03 13:23:22 PDT
EWS
Comment 3 2026-04-03 18:25:56 PDT
Committed 310549@main (6e308cecbfca): <https://commits.webkit.org/310549@main> Reviewed commits have been landed. Closing PR #61992 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.