Class: Selenium::DevTools::V130::LayerTree

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/devtools/v130/layer_tree.rb

Constant Summary collapse

EVENTS =
{
  layer_painted: 'layerPainted',
  layer_tree_did_change: 'layerTreeDidChange',
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(devtools) ⇒ LayerTree

Returns a new instance of LayerTree.



30
31
32
# File 'lib/selenium/devtools/v130/layer_tree.rb', line 30

def initialize(devtools)
  @devtools = devtools
end

Instance Method Details

#compositing_reasons(layer_id:) ⇒ Object



39
40
41
42
# File 'lib/selenium/devtools/v130/layer_tree.rb', line 39

def compositing_reasons(layer_id:)
  @devtools.send_cmd('LayerTree.compositingReasons',
                     layerId: layer_id)
end

#disableObject



44
45
46
# File 'lib/selenium/devtools/v130/layer_tree.rb', line 44

def disable
  @devtools.send_cmd('LayerTree.disable')
end

#enableObject



48
49
50
# File 'lib/selenium/devtools/v130/layer_tree.rb', line 48

def enable
  @devtools.send_cmd('LayerTree.enable')
end

#load_snapshot(tiles:) ⇒ Object



52
53
54
55
# File 'lib/selenium/devtools/v130/layer_tree.rb', line 52

def load_snapshot(tiles:)
  @devtools.send_cmd('LayerTree.loadSnapshot',
                     tiles: tiles)
end

#make_snapshot(layer_id:) ⇒ Object



57
58
59
60
# File 'lib/selenium/devtools/v130/layer_tree.rb', line 57

def make_snapshot(layer_id:)
  @devtools.send_cmd('LayerTree.makeSnapshot',
                     layerId: layer_id)
end

#on(event, &block) ⇒ Object



34
35
36
37
# File 'lib/selenium/devtools/v130/layer_tree.rb', line 34

def on(event, &block)
  event = EVENTS[event] if event.is_a?(Symbol)
  @devtools.callbacks["LayerTree.#{event}"] << block
end

#profile_snapshot(snapshot_id:, min_repeat_count: nil, min_duration: nil, clip_rect: nil) ⇒ Object



62
63
64
65
66
67
68
# File 'lib/selenium/devtools/v130/layer_tree.rb', line 62

def profile_snapshot(snapshot_id:, min_repeat_count: nil, min_duration: nil, clip_rect: nil)
  @devtools.send_cmd('LayerTree.profileSnapshot',
                     snapshotId: snapshot_id,
                     minRepeatCount: min_repeat_count,
                     minDuration: min_duration,
                     clipRect: clip_rect)
end

#release_snapshot(snapshot_id:) ⇒ Object



70
71
72
73
# File 'lib/selenium/devtools/v130/layer_tree.rb', line 70

def release_snapshot(snapshot_id:)
  @devtools.send_cmd('LayerTree.releaseSnapshot',
                     snapshotId: snapshot_id)
end

#replay_snapshot(snapshot_id:, from_step: nil, to_step: nil, scale: nil) ⇒ Object



75
76
77
78
79
80
81
# File 'lib/selenium/devtools/v130/layer_tree.rb', line 75

def replay_snapshot(snapshot_id:, from_step: nil, to_step: nil, scale: nil)
  @devtools.send_cmd('LayerTree.replaySnapshot',
                     snapshotId: snapshot_id,
                     fromStep: from_step,
                     toStep: to_step,
                     scale: scale)
end

#snapshot_command_log(snapshot_id:) ⇒ Object



83
84
85
86
# File 'lib/selenium/devtools/v130/layer_tree.rb', line 83

def snapshot_command_log(snapshot_id:)
  @devtools.send_cmd('LayerTree.snapshotCommandLog',
                     snapshotId: snapshot_id)
end