Skip to content

Commit 1071a0b

Browse files
committed
fix failures
1 parent f918fa1 commit 1071a0b

File tree

5 files changed

+9
-15
lines changed

5 files changed

+9
-15
lines changed

rb/lib/selenium/webdriver/remote/http/default.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ class Default < Common
3232
# Debuggers that freeze the process will not be able to evaluate any operations if that happens.
3333
# @param [Numeric] open_timeout - Open timeout to apply to HTTP client.
3434
# @param [Numeric] read_timeout - Read timeout (seconds) to apply to HTTP client.
35-
def initialize(open_timeout: nil, read_timeout: nil, socket_timeout: 30, socket_interval: 0.1)
35+
def initialize(open_timeout: nil, read_timeout: nil, socket_timeout: nil, socket_interval: nil)
3636
@open_timeout = open_timeout
3737
@read_timeout = read_timeout
38-
@socket_timeout = socket_timeout
39-
@socket_interval = socket_interval
38+
@socket_timeout = socket_timeout || 30
39+
@socket_interval = socket_interval || 0.1
4040
super()
4141
end
4242

rb/sig/lib/selenium/webdriver/remote/http/common.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module Selenium
1717

1818
def self.user_agent: -> String
1919

20-
attr_writer server_url: String
20+
attr_writer server_url: URI::Generic
2121

2222
def quit_errors: () -> Array[untyped]
2323

rb/sig/lib/selenium/webdriver/remote/http/default.rbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ module Selenium
2020

2121
attr_accessor socket_timeout: int
2222

23-
attr_accessor socket_interval: float
23+
attr_accessor socket_interval: Numeric
2424

25-
def initialize: (?open_timeout: untyped?, ?read_timeout: untyped?) -> void
25+
def initialize: (?open_timeout: untyped?, ?read_timeout: untyped?, ?socket_timeout: int?, ?socket_interval: Numeric?) -> void
2626

2727
def close: () -> untyped
2828

rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,14 @@ def root
169169
@root ||= Pathname.new('../../../../../../../').realpath(__FILE__)
170170
end
171171

172-
def create_driver!(listener: nil, **opts, &block)
172+
def create_driver!(listener: nil, **, &block)
173173
check_for_previous_error
174174

175-
socket_timeout = opts.delete(:socket_timeout)
176-
http_client = WebDriver::Remote::Http::Default.new(socket_timeout: socket_timeout) if socket_timeout
177-
178175
method = :"#{driver}_driver"
179176
instance = if private_methods.include?(method)
180-
send(method, listener: listener, http_client: http_client, options: build_options(**opts))
177+
send(method, listener: listener, options: build_options(**))
181178
else
182-
WebDriver::Driver.for(driver, listener: listener, options: build_options(**opts))
179+
WebDriver::Driver.for(driver, listener: listener, options: build_options(**))
183180
end
184181
@create_driver_error_count -= 1 unless @create_driver_error_count.zero?
185182
if block

rb/spec/unit/selenium/webdriver/remote/http/default_spec.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ module Http
3636

3737
expect(http.open_timeout).to eq 60
3838
expect(http.read_timeout).to eq 60
39-
expect(http.socket_timeout).to eq 30
40-
expect(http.socket_interval).to eq 0.1
4139
end
4240

4341
describe '#initialize' do
@@ -50,7 +48,6 @@ module Http
5048
expect(client.read_timeout).to eq 22
5149
expect(client.socket_timeout).to eq 4
5250
expect(client.socket_interval).to eq 0.5
53-
5451
end
5552
end
5653

0 commit comments

Comments
 (0)