selenium-webdriver 2.31.0 → 2.32.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -68,28 +68,14 @@ module Selenium
68
68
  end
69
69
 
70
70
  HEADERS = <<-HEADERS
71
- HTTP/1.1 200 OK
71
+ HTTP/1.1 %d %s
72
72
  Content-Type: text/html; charset=utf-8
73
73
  Server: safaridriver-ruby
74
74
  HEADERS
75
75
 
76
76
  HEADERS.gsub!("\n", "\r\n")
77
77
 
78
- HTML = <<-HTML
79
- <!DOCTYPE html>
80
- <h2>SafariDriver requesting connection at %s</h2>
81
- <script>
82
- // Must wait for onload so the injected script is loaded by the
83
- // SafariDriver extension.
84
- window.onload = function() {
85
- window.postMessage({
86
- 'type': 'connect',
87
- 'origin': 'webdriver',
88
- 'url': '%s'
89
- }, '*');
90
- };
91
- </script>
92
- HTML
78
+ HTML = "<!DOCTYPE html><script>#{Safari.resource_path.join('client.js').read}</script>"
93
79
 
94
80
  def process_initial_http_request
95
81
  http = @server.accept
@@ -99,11 +85,19 @@ window.onload = function() {
99
85
  req << http.read(1)
100
86
  end
101
87
 
102
- http << HEADERS
103
- http << "\r\n\r\n"
104
- http << HTML % [ws_uri, ws_uri]
105
-
106
- http.close
88
+ if !req.include?("?url=")
89
+ http << HEADERS % [302, 'Moved Temporarily']
90
+ http << "Location: #{uri}?url=#{encode_form_component ws_uri}\r\n"
91
+ http << "\r\n\r\n"
92
+ http.close
93
+
94
+ process_initial_http_request
95
+ else
96
+ http << HEADERS % [200, 'OK']
97
+ http << "\r\n\r\n"
98
+ http << HTML
99
+ http.close
100
+ end
107
101
  end
108
102
 
109
103
  def process_handshake
@@ -135,6 +129,15 @@ window.onload = function() {
135
129
  @server.close
136
130
  @version = hs.version
137
131
  end
132
+
133
+ def encode_form_component(str)
134
+ if URI.respond_to?(:encode_www_form_component) # >= 1.9
135
+ URI.encode_form_component(str)
136
+ else
137
+ # best effort for 1.8
138
+ str.gsub(":", '%3A').gsub('/', '%2F')
139
+ end
140
+ end
138
141
  end
139
142
 
140
143
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: selenium-webdriver
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 2.31.0
5
+ version: 2.32.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jari Bakken
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2013-03-02 00:00:00 +01:00
13
+ date: 2013-04-09 00:00:00 +02:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -215,14 +215,17 @@ files:
215
215
  - lib/selenium/webdriver/remote/http/persistent.rb
216
216
  - lib/selenium/webdriver/safari/bridge.rb
217
217
  - lib/selenium/webdriver/safari/browser.rb
218
+ - lib/selenium/webdriver/safari/extension.rb
218
219
  - lib/selenium/webdriver/safari/server.rb
220
+ - lib/selenium/webdriver/safari/resources/client.js
221
+ - lib/selenium/webdriver/safari/resources/SafariDriver.safariextz
219
222
  - lib/selenium/webdriver/support/abstract_event_listener.rb
220
223
  - lib/selenium/webdriver/support/block_event_listener.rb
221
224
  - lib/selenium/webdriver/support/color.rb
222
225
  - lib/selenium/webdriver/support/event_firing_bridge.rb
223
226
  - lib/selenium/webdriver/support/select.rb
224
227
  - CHANGES
225
- - README
228
+ - README.md
226
229
  - COPYING
227
230
  has_rdoc: true
228
231
  homepage: http://selenium.googlecode.com