Sha256: 59d4222737a00a370fbdd8d646a7e39dbef310ea3023677d87e6865036a49ea4

Contents?: true

Size: 1.32 KB

Versions: 8

Compression:

Stored size: 1.32 KB

Contents

module Selenium
  module WebDriver
    module Firefox

      # @api private
      class Bridge < Remote::Bridge

        def initialize(opts = {})
          port        = opts.delete(:port) || DEFAULT_PORT
          profile     = opts.delete(:profile)
          http_client = opts.delete(:http_client)

          @launcher   = create_launcher(port, profile)

          unless opts.empty?
            raise ArgumentError, "unknown option#{'s' if opts.size != 1}: #{opts.inspect}"
          end

          @launcher.launch

          remote_opts = {
            :url                  => @launcher.url,
            :desired_capabilities => Remote::Capabilities.firefox(:native_events => DEFAULT_ENABLE_NATIVE_EVENTS)
          }

          remote_opts.merge!(:http_client => http_client) if http_client

          super(remote_opts)
        end

        def browser
          :firefox
        end

        def driver_extensions
          [
            DriverExtensions::TakesScreenshot,
            DriverExtensions::HasInputDevices
          ]
        end

        def quit
          super
          nil
        ensure
          @launcher.quit
        end

        private

        def create_launcher(port, profile)
          Launcher.new Binary.new, port, profile
        end

      end # Bridge
    end # Firefox
  end # WebDriver
end # Selenium

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
selenium-webdriver-2.22.2 lib/selenium/webdriver/firefox/bridge.rb
selenium-webdriver-2.22.2.rc2 lib/selenium/webdriver/firefox/bridge.rb
selenium-webdriver-2.22.2.rc1 lib/selenium/webdriver/firefox/bridge.rb
selenium-webdriver-2.22.1 lib/selenium/webdriver/firefox/bridge.rb
selenium-webdriver-2.22.0 lib/selenium/webdriver/firefox/bridge.rb
selenium-webdriver-2.22.0.rc3 lib/selenium/webdriver/firefox/bridge.rb
selenium-webdriver-2.22.0.rc2 lib/selenium/webdriver/firefox/bridge.rb
selenium-webdriver-2.22.0.rc1 lib/selenium/webdriver/firefox/bridge.rb