Bug 188514

Summary: WebDriver: handle elements of type file in send keys command
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebDriverAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, cdumez, dbates, esprehn+autocc, ews-watchlist, gyuyoung.kim, mifenton, tkent, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=204292
Attachments:
Description Flags
Patch
ews-watchlist: commit-queue-
Archive of layout-test-results from ews210 for win-future
none
Patch
none
Patch bburg: review+

Description Carlos Garcia Campos 2018-08-13 05:36:47 PDT
https://w3c.github.io/webdriver/#element-send-keys
Comment 1 Carlos Garcia Campos 2019-11-18 03:59:44 PST
Created attachment 383738 [details]
Patch
Comment 2 Carlos Garcia Campos 2019-11-18 04:08:57 PST
*** Bug 188513 has been marked as a duplicate of this bug. ***
Comment 3 EWS Watchlist 2019-11-18 05:46:18 PST
Comment on attachment 383738 [details]
Patch

Attachment 383738 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/13264000

New failing tests:
fast/forms/file/file-input-user-selection-events.html
Comment 4 EWS Watchlist 2019-11-18 05:46:21 PST
Created attachment 383740 [details]
Archive of layout-test-results from ews210 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews210  Port: win-future  Platform: CYGWIN_NT-10.0-17763-3.0.5-338.x86_64-x86_64-64bit
Comment 5 Carlos Garcia Campos 2019-11-25 01:34:27 PST
Ping Brian?
Comment 6 Carlos Garcia Campos 2019-11-26 00:31:35 PST
I've just realized I submitted the wrong patch here...
Comment 7 Carlos Garcia Campos 2019-11-26 00:34:05 PST
Created attachment 384330 [details]
Patch

This is the right one
Comment 8 Carlos Garcia Campos 2019-11-26 08:20:32 PST
Build failures in apple ports would be a matter of exporting symbols I think, I'll submit an updated patch.
Comment 9 Carlos Garcia Campos 2019-11-27 02:01:16 PST
Created attachment 384403 [details]
Patch
Comment 10 BJ Burg 2019-12-02 16:09:59 PST
taking a look.
Comment 11 BJ Burg 2019-12-02 16:21:28 PST
Comment on attachment 384403 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=384403&action=review

r=me

> Source/WebDriver/Session.cpp:1569
> +Session::IsFileUpload Session::parseElementIsFileUploadResult(const RefPtr<JSON::Value>& resultValue)

I would have encoded it as Optional<FileUploadType> and have FileUploadType be one of {Single, Multiple}.

> Source/WebKit/ChangeLog:9
> +        differently, so I'm keeping both to not break safari driver. The new one simply sends the file list ot the web

Typo: ot -> to, safari driver -> safaridriver.

> Source/WebKit/ChangeLog:11
> +        panel, intercept and complete the open panel request and send a dismiss open panel event to the driver.

I don't recall offhand why I didn't pursue an approach like yours. Perhaps it was related to sandboxing not being able to open the file without going through the file chooser path (which grants a sandbox exception for the selected files)?
Comment 12 Carlos Garcia Campos 2019-12-03 02:03:39 PST
Committed r253030: <https://trac.webkit.org/changeset/253030>
Comment 13 Radar WebKit Bug Importer 2019-12-03 02:04:37 PST
<rdar://problem/57585779>