Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: morganchristiansson/capybara-webkit
...
head fork: ngauthier/capybara-webkit
  • 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
26 lib/capybara/driver/webkit/browser.rb
View
@@ -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.