Skip to content
This repository has been archived by the owner on Aug 12, 2021. It is now read-only.

Commit

Permalink
rb - turns out @process.stop doesn't work if process isn't running, …
Browse files Browse the repository at this point in the history
…and specs would have caught this if they were working.
  • Loading branch information
titusfortner committed Mar 6, 2016
1 parent b73ca5d commit dc4cc79
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
10 changes: 7 additions & 3 deletions rb/lib/selenium/webdriver/chrome/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,8 @@ def stop
http.get("/shutdown")
end

@process.poll_for_exit STOP_TIMEOUT
rescue ChildProcess::TimeoutError
ensure
@process.stop STOP_TIMEOUT
stop_process
end

def uri
Expand All @@ -105,6 +103,12 @@ def start_process
@process.start
end

def stop_process
@process.poll_for_exit STOP_TIMEOUT
rescue ChildProcess::TimeoutError
@process.stop STOP_TIMEOUT
end

def connect_until_stable
socket_poller = SocketPoller.new @host, @port, START_TIMEOUT

Expand Down
24 changes: 10 additions & 14 deletions rb/spec/integration/selenium/webdriver/chrome/driver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,15 @@ module Chrome
compliant_on :browser => :chrome do
describe Driver do

not_compliant_on :ci => :travis do
it "should accept an array of custom command line arguments" do
begin
driver = Selenium::WebDriver.for :chrome, :args => ["--user-agent=foo;bar"]
driver.navigate.to url_for("click_jacker.html")

ua = driver.execute_script "return window.navigator.userAgent"
expect(ua).to eq("foo;bar")
ensure
driver.quit if driver
end
it "should accept an array of custom command line arguments" do
begin
driver = Selenium::WebDriver.for :chrome, :args => ["--user-agent=foo;bar"]
driver.navigate.to url_for("click_jacker.html")

ua = driver.execute_script "return window.navigator.userAgent"
expect(ua).to eq("foo;bar")
ensure
driver.quit if driver
end
end

Expand All @@ -46,9 +44,7 @@ module Chrome
}.to raise_error(ArgumentError)
end

not_compliant_on :ci => :travis do
it_behaves_like "driver that can be started concurrently", :chrome
end
it_behaves_like "driver that can be started concurrently", :chrome
end
end

Expand Down

0 comments on commit dc4cc79

Please sign in to comment.