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 / Tests | Assignee: | 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
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/174033719>
Anthony Tarbinian
Pull request: https://github.com/WebKit/WebKit/pull/61992
EWS
Committed 310549@main (6e308cecbfca): <https://commits.webkit.org/310549@main>
Reviewed commits have been landed. Closing PR #61992 and removing active labels.