Hi,
Not sure if it’s easily testable. In the Framework UI tests, it’s just done like this:
https://github.com/vaadin/framework/blob/master/uitest/src/test/java/com/vaadin/tests/components/FileDownloaderUITest.java
Corresponding test UI here: https://github.com/vaadin/framework/blob/master/uitest/src/main/java/com/vaadin/tests/components/FileDownloaderUI.java
-Olli