def wait_for(conditions)
    unless WebkitRemote::Event.can_receive? self, conditions
      raise ArgumentError, "Cannot receive event with #{conditions.inspect}"
    end

    events = []
    each_event do |event|
      events << event
      break if event.matches?(conditions)
    end
    events
  end
def wait_for(conditions)
    unless WebkitRemote::Event.can_receive? self, conditions
      raise ArgumentError, "Cannot receive event with #{conditions.inspect}"
    end

    events = []
    each_event do |event|
      events << event
      break if event.matches?(conditions)
    end
    events
  end
Waits for the remote debugging server to send a specific event.

 @param (see WebkitRemote::Event#matches?)
 @return [Array<WebkitRemote::Event>] all the events received, including the
     event that matches the class requirement