28
28
import static org .openqa .selenium .testing .Driver .CHROME ;
29
29
import static org .openqa .selenium .testing .Driver .HTMLUNIT ;
30
30
import static org .openqa .selenium .testing .Driver .IE ;
31
- import static org .openqa .selenium .testing .Driver .MARIONETTE ;
32
31
import static org .openqa .selenium .testing .Driver .SAFARI ;
33
32
import static org .openqa .selenium .testing .TestUtilities .catchThrowable ;
34
33
@@ -63,7 +62,7 @@ public void setUp() throws Exception {
63
62
64
63
@ SwitchToTopAfterTest
65
64
@ Test
66
- public void testFileUploading () throws Exception {
65
+ public void testFileUploading () {
67
66
assumeFalse (
68
67
"This test as written assumes a file on local disk is accessible to the browser. "
69
68
+ "That is not true for browsers on mobile platforms." ,
@@ -85,7 +84,7 @@ public void testFileUploading() throws Exception {
85
84
@ Test
86
85
@ Ignore (IE )
87
86
@ Ignore (SAFARI )
88
- public void testCleanFileInput () throws Exception {
87
+ public void testCleanFileInput () {
89
88
driver .get (pages .uploadPage );
90
89
WebElement element = driver .findElement (By .id ("upload" ));
91
90
element .sendKeys (testFile .getAbsolutePath ());
@@ -106,7 +105,7 @@ public void testClickFileInput() {
106
105
}
107
106
108
107
@ Test
109
- public void testUploadingWithHiddenFileInput () throws Exception {
108
+ public void testUploadingWithHiddenFileInput () {
110
109
driver .get (appServer .whereIs ("upload_invisible.html" ));
111
110
driver .findElement (By .id ("upload" )).sendKeys (testFile .getAbsolutePath ());
112
111
driver .findElement (By .id ("go" )).click ();
@@ -125,7 +124,7 @@ public void testUploadingWithHiddenFileInput() throws Exception {
125
124
private File createTmpFile (String content ) throws IOException {
126
125
File f = File .createTempFile ("webdriver" , "tmp" );
127
126
f .deleteOnExit ();
128
- Files .write ( content , f , StandardCharsets .UTF_8 );
127
+ Files .asCharSink ( f , StandardCharsets .UTF_8 ). write ( content );
129
128
return f ;
130
129
}
131
130
0 commit comments