haikuwebkit/LayoutTests/accessibility/axpress-on-aria-button-expe...

20 lines
381 B
Plaintext
Raw Permalink Normal View History

Add a way to test file input without relying on drag and drop https://bugs.webkit.org/show_bug.cgi?id=168848 <rdar://problem/22258242> Reviewed by Tim Horton. Tools: Existing layout tests relied on drag and drop support in EventSender to configure a file input element for testing. This had several problems: 1. WebKitTestRunner has no support for beginDragWithFiles(), and DumpRenderTree doesn't support it on iOS. 2. We have no test coverage for selecting files via the runOpenPanel UI delegate, leading to bugs like webkit.org/b/159686. Even if we fixed (1), we'd still have a test coverage gap due to (2), so this patch introduces a way for a test to specify the list of files that should be selected by the runOpenPanel UI delegate: TestRunner.setOpenPanelFiles(). It also creates versions of a number of existing file input tests using TestRunner.setOpenPanelFiles() instead of EventSender.beginDragWithFiles(). * DumpRenderTree/ios/DumpRenderTreeBrowserView.mm: (-[DumpRenderTreeBrowserView webView:runOpenPanelForFileButtonWithResultListener:configuration:]): Overrode to call the corresponding method on UIDelegate. * DumpRenderTree/TestRunner.cpp: (setOpenPanelFilesCallback): Added to call TestRunner::setOpenPanelFiles(). (TestRunner::staticFunctions): Registered setOpenPanelFiles. (TestRunner::setOpenPanelFiles): Added. Converts the JavaScript array of file paths to a std::vector of std::strings. * DumpRenderTree/TestRunner.h: (TestRunner::openPanelFiles): * DumpRenderTree/mac/UIDelegate.mm: (-[UIDelegate webView:runOpenPanelForFileButtonWithResultListener:allowMultipleFiles:]): Added. Converts the array of file paths to an NSArray of NSURLs, resolving the file paths relative to the current test URL. Returns either the first item or all items depending on the value of allowMultipleFiles. * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: Defined setOpenPanelFiles. * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setOpenPanelFiles): Added. Converts the JavaScript array of file paths to a WKArray of WKURLs, resolving the file paths relative to the current test URL, and sends the WKArray to the UI process with the "SetOpenPanelFileURLs" message. * WebKitTestRunner/InjectedBundle/TestRunner.h: * WebKitTestRunner/TestController.cpp: (WTR::runOpenPanel): Calls the WKOpenPanelResultListener with either the first item or all items, depending on the value of WKOpenPanelParametersGetAllowsMultipleFiles(). (WTR::TestController::resetStateToConsistentValues): Clear m_openPanelFileURLs. * WebKitTestRunner/TestController.h: (WTR::TestController::openPanelFileURLs): (WTR::TestController::setOpenPanelFileURLs): * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): Added code to handle the "SetOpenPanelFileURLs" message. LayoutTests: Added versions of existing file input tests that use TestRunner.setOpenPanelFiles() instead of EventSender.beginDragWithFiles(). * fast/dom/FileList-iterator-using-open-panel-expected.txt: Added. * fast/dom/FileList-iterator-using-open-panel.html: Added. * fast/files/apply-blob-url-to-img-using-open-panel-expected.txt: Added. * fast/files/apply-blob-url-to-img-using-open-panel.html: Added. * fast/files/apply-blob-url-to-xhr-using-open-panel-expected.txt: Added. * fast/files/apply-blob-url-to-xhr-using-open-panel.html: Added. * fast/files/file-list-test-using-open-panel-expected.txt: Added. * fast/files/file-list-test-using-open-panel.html: Added. * fast/files/file-reader-abort-using-open-panel-expected.txt: Added. * fast/files/file-reader-abort-using-open-panel.html: Added. * fast/files/file-reader-directory-crash-using-open-panel-expected.txt: Added. * fast/files/file-reader-directory-crash-using-open-panel.html: Added. * fast/files/filereader-zip-bundle-using-open-panel-expected.txt: Added. * fast/files/filereader-zip-bundle-using-open-panel.html: Added. * fast/forms/file/file-input-reset-using-open-panel-expected.html: Added. * fast/forms/file/file-input-reset-using-open-panel.html: Added. * fast/forms/file/file-reset-in-change-using-open-panel-expected.html: Added. * fast/forms/file/file-reset-in-change-using-open-panel.html: Added. * fast/forms/file/get-file-upload-using-open-panel-expected.txt: Added. * fast/forms/file/get-file-upload-using-open-panel.html: Added. * fast/forms/file/input-file-value-using-open-panel-expected.txt: Added. * fast/forms/file/input-file-value-using-open-panel.html: Added. * fast/forms/file/input-file-write-files-using-open-panel-expected.txt: Added. * fast/forms/file/input-file-write-files-using-open-panel.html: Added. * fast/history/page-cache-createObjectURL-using-open-panel-expected.txt: Added. * fast/history/page-cache-createObjectURL-using-open-panel.html: Added. * http/tests/local/blob/resources/hybrid-blob-util.js: (this.setupForTests): (this.runTestsWithDrag): (this.runTestsWithOpenPanel): (this.runTests): * http/tests/local/blob/script-tests/send-hybrid-blob-using-open-panel.js: Added. (runHybridBlobTest): (runTests.F): (runTests.D): (runTests): * http/tests/local/blob/send-hybrid-blob-using-open-panel-expected.txt: Added. * http/tests/local/blob/send-hybrid-blob-using-open-panel.html: Added. * http/tests/local/fileapi/file-last-modified-after-delete-using-open-panel-expected.txt: Added. * http/tests/local/fileapi/file-last-modified-after-delete-using-open-panel.html: Added. * http/tests/local/fileapi/file-last-modified-using-open-panel-expected.txt: Added. * http/tests/local/fileapi/file-last-modified-using-open-panel.html: Added. * http/tests/local/fileapi/resources/setup-file-input-element-for-drag.js: (setFileInputChangeCallback): * http/tests/local/fileapi/script-tests/file-last-modified-after-delete-using-open-panel.js: Added. (onFileChange): (runTest): * http/tests/local/fileapi/script-tests/file-last-modified-using-open-panel.js: Added. (onFileChange): (runTest): * http/tests/local/fileapi/upload-zip-bundle-as-blob-using-open-panel-expected.txt: Added. * http/tests/local/fileapi/upload-zip-bundle-as-blob-using-open-panel.html: Added. * http/tests/local/formdata/send-form-data-constructed-from-form-using-open-panel-expected.txt: Added. * http/tests/local/formdata/send-form-data-constructed-from-form-using-open-panel.html: Added. * http/tests/local/formdata/send-form-data-with-empty-file-filename-using-open-panel-expected.txt: Added. * http/tests/local/formdata/send-form-data-with-empty-file-filename-using-open-panel.html: Added. * media/video-src-blob-using-open-panel-expected.txt: Added. * media/video-src-blob-using-open-panel.html: Added. * platform/ios-simulator/TestExpectations: Canonical link: https://commits.webkit.org/185893@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213042 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-27 09:49:29 +00:00
OPEN FILE PANEL
Upload
Upload
Upload
This tests that if a non-native action type is exposed as a control, then we will look for descendants to call press() on.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Press performed on fileupload
Press performed on button
Press performed on checkbox
PASS successfullyParsed is true
TEST COMPLETE