Sha256: 77613bfe70c34b20d6c262071240a5edbba335f252b48cdabb8092a3228eaeea

Contents?: true

Size: 1.3 KB

Versions: 47

Compression:

Stored size: 1.3 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
          @launcher.quit

          nil
        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

47 entries across 47 versions & 4 rubygems

Version Path
selenium-webdriver-2.3.2 lib/selenium/webdriver/firefox/bridge.rb
selenium-webdriver-2.3.0 lib/selenium/webdriver/firefox/bridge.rb
selenium-webdriver-2.2.0 lib/selenium/webdriver/firefox/bridge.rb
selenium-webdriver-2.1.0 lib/selenium/webdriver/firefox/bridge.rb
selenium-webdriver-2.0.1 lib/selenium/webdriver/firefox/bridge.rb
selenium-webdriver-2.0.0 lib/selenium/webdriver/firefox/bridge.rb
selenium-webdriver-0.2.2 lib/selenium/webdriver/firefox/bridge.rb