Class: Selenium::DevTools::V129::PerformanceTimeline
- Inherits:
-
Object
- Object
- Selenium::DevTools::V129::PerformanceTimeline
- Defined in:
- lib/selenium/devtools/v129/performance_timeline.rb
Constant Summary collapse
- EVENTS =
{ timeline_event_added: 'timelineEventAdded', }.freeze
Instance Method Summary collapse
- #enable(event_types:) ⇒ Object
-
#initialize(devtools) ⇒ PerformanceTimeline
constructor
A new instance of PerformanceTimeline.
- #on(event, &block) ⇒ Object
Constructor Details
#initialize(devtools) ⇒ PerformanceTimeline
Returns a new instance of PerformanceTimeline.
29 30 31 |
# File 'lib/selenium/devtools/v129/performance_timeline.rb', line 29 def initialize(devtools) @devtools = devtools end |
Instance Method Details
#enable(event_types:) ⇒ Object
38 39 40 41 |
# File 'lib/selenium/devtools/v129/performance_timeline.rb', line 38 def enable(event_types:) @devtools.send_cmd('PerformanceTimeline.enable', eventTypes: event_types) end |
#on(event, &block) ⇒ Object
33 34 35 36 |
# File 'lib/selenium/devtools/v129/performance_timeline.rb', line 33 def on(event, &block) event = EVENTS[event] if event.is_a?(Symbol) @devtools.callbacks["PerformanceTimeline.#{event}"] << block end |