module Selenium::WebDriver::Chromium::Features

def available_log_types

def available_log_types
  types = execute :get_available_log_types
  Array(types).map(&:to_sym)
end

def cast_issue_message

def cast_issue_message
  execute :cast_issue_message
end

def cast_sink_to_use=(name)

def cast_sink_to_use=(name)
  execute :set_cast_sink_to_use, {}, {sinkName: name}
end

def cast_sinks

def cast_sinks
  execute :get_cast_sinks
end

def delete_network_conditions

def delete_network_conditions
  execute :delete_network_conditions
end

def launch_app(id)

def launch_app(id)
  execute :launch_app, {}, {id: id}
end

def log(type)

def log(type)
  data = execute :get_log, {}, {type: type.to_s}
  Array(data).map do |l|
    LogEntry.new l.fetch('level', 'UNKNOWN'), l.fetch('timestamp'), l.fetch('message')
  rescue KeyError
    next
  end
end

def network_conditions

def network_conditions
  execute :get_network_conditions
end

def network_conditions=(conditions)

def network_conditions=(conditions)
  execute :set_network_conditions, {}, {network_conditions: conditions}
end

def send_command(command_params)

def send_command(command_params)
  execute :send_command, {}, command_params
end

def set_permission(name, value)

def set_permission(name, value)
  execute :set_permission, {}, {descriptor: {name: name}, state: value}
end

def start_cast_desktop_mirroring(name)

def start_cast_desktop_mirroring(name)
  execute :start_cast_desktop_mirroring, {}, {sinkName: name}
end

def start_cast_tab_mirroring(name)

def start_cast_tab_mirroring(name)
  execute :start_cast_tab_mirroring, {}, {sinkName: name}
end

def stop_casting(name)

def stop_casting(name)
  execute :stop_casting, {}, {sinkName: name}
end