lib/selenium/webdriver/chrome/launcher.rb in selenium-webdriver-0.1.1 vs lib/selenium/webdriver/chrome/launcher.rb in selenium-webdriver-0.1.2
- old
+ new
@@ -1,10 +1,10 @@
module Selenium
module WebDriver
module Chrome
- # @private
+ # @api private
class Launcher
include FileUtils
attr_reader :pid
@@ -19,11 +19,11 @@
path || raise(Error::WebDriverError, "Could not find Chrome binary. Make sure Chrome is installed (OS: #{Platform.os})")
)
end
#
- # @private
+ # @api private
#
# @see Chrome.path=
#
def self.binary_path=(path)
@@ -56,12 +56,14 @@
touch "#{tmp_profile_dir}/First Run"
touch "#{tmp_profile_dir}/First Run Dev"
end
def launch_chrome(server_url)
+ path = self.class.binary_path
+
args = [
- Platform.wrap_in_quotes_if_necessary(self.class.binary_path),
+ Platform.wrap_in_quotes_if_necessary(path),
"--load-extension=#{Platform.wrap_in_quotes_if_necessary(tmp_extension_dir)}",
"--activate-on-launch",
"--disable-hang-monitor",
"--disable-popup-blocking",
"--disable-prompt-on-repost"
@@ -136,16 +138,20 @@
"#{Platform.home}/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
]
end
def windows_paths
- [
+ paths = [
windows_registry_path,
"#{ENV['USERPROFILE']}\\Local Settings\\Application Data\\Google\\Chrome\\Application\\chrome.exe",
"#{ENV['USERPROFILE']}\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe",
"#{Platform.home}\\Local Settings\\Application Data\\Google\\Chrome\\Application\\chrome.exe",
"#{Platform.home}\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe",
].compact
+
+ paths.map! { |path| Platform.cygwin_path(path) } if Platform.cygwin?
+
+ paths
end
def windows_registry_path
require "win32/registry"