18
18
package org .openqa .selenium .htmlunit ;
19
19
20
20
import java .time .Duration ;
21
- import java .util .concurrent .TimeUnit ;
22
21
23
22
import org .htmlunit .WebClient ;
24
23
import org .openqa .selenium .WebDriver ;
@@ -40,37 +39,23 @@ public HtmlUnitTimeouts() {
40
39
}
41
40
42
41
public HtmlUnitTimeouts (final WebClient webClient ) {
43
- this . webClient_ = webClient ;
42
+ webClient_ = webClient ;
44
43
}
45
44
46
45
@ Override
47
46
public Duration getImplicitWaitTimeout () {
48
47
return Duration .ofMillis (implicitWait_ );
49
48
}
50
49
51
- @ Deprecated
52
- @ Override
53
- public WebDriver .Timeouts implicitlyWait (final long time , final TimeUnit unit ) {
54
- implicitlyWait (Duration .ofMillis (TimeUnit .MILLISECONDS .convert (time , unit )));
55
- return this ;
56
- }
57
-
58
50
@ Override
59
51
public WebDriver .Timeouts implicitlyWait (final Duration duration ) {
60
- this . implicitWait_ = Math .max (0 , duration .toMillis ());
52
+ implicitWait_ = Math .max (0 , duration .toMillis ());
61
53
return this ;
62
54
}
63
55
64
56
@ Override
65
57
public WebDriver .Timeouts scriptTimeout (final Duration duration ) {
66
- this .scriptTimeout_ = duration .toMillis ();
67
- return this ;
68
- }
69
-
70
- @ Deprecated
71
- @ Override
72
- public WebDriver .Timeouts setScriptTimeout (final long time , final TimeUnit unit ) {
73
- scriptTimeout (Duration .ofMillis (TimeUnit .MILLISECONDS .convert (time , unit )));
58
+ scriptTimeout_ = duration .toMillis ();
74
59
return this ;
75
60
}
76
61
@@ -79,16 +64,9 @@ public Duration getScriptTimeout() {
79
64
return Duration .ofMillis (scriptTimeout_ );
80
65
}
81
66
82
- @ Deprecated
83
- @ Override
84
- public WebDriver .Timeouts pageLoadTimeout (final long time , final TimeUnit unit ) {
85
- pageLoadTimeout (Duration .ofMillis (TimeUnit .MILLISECONDS .convert (time , unit )));
86
- return this ;
87
- }
88
-
89
67
@ Override
90
68
public WebDriver .Timeouts pageLoadTimeout (final Duration duration ) {
91
- this . pageLoadTimeout_ = duration .toMillis ();
69
+ pageLoadTimeout_ = duration .toMillis ();
92
70
setPageLoadTimeoutForWebClient (webClient_ , pageLoadTimeout_ );
93
71
return this ;
94
72
}
0 commit comments