Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 18 additions and 8 deletions.
  1. +18 −8 lib/capybara/driver/webkit/browser.rb
View
26 lib/capybara/driver/webkit/browser.rb
@@ -64,14 +64,7 @@ def frame_focus(frame_id_or_index=nil)
end
def command(name, *args)
- @socket.puts name
- @socket.puts args.size
- args.each do |arg|
- @socket.puts arg.to_s.bytesize
- @socket.print arg.to_s
- end
- check
- read_response
+ retry_command(0, name, *args)
end
def evaluate_script(script)
@@ -212,5 +205,22 @@ def default_proxy_options
:pass => ""
}
end
+
+ def retry_command(count, name, *args)
+ @socket.puts name
+ @socket.puts args.size
+ args.each do |arg|
+ @socket.puts arg.to_s.bytesize
+ @socket.print arg.to_s
+ end
+ check
+ read_response
+ rescue Capybara::Driver::Webkit::WebkitInvalidResponseError => ex
+ if count > 2
+ raise ex
+ else
+ retry_command(count+1, name, *args)
+ end
+ end
end
end

No commit comments for this range

Something went wrong with that request. Please try again.