playwright-ruby-client 0.0.6 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +117 -5
  3. data/docs/api_coverage.md +359 -0
  4. data/lib/playwright.rb +6 -2
  5. data/lib/playwright/android_input_impl.rb +23 -0
  6. data/lib/playwright/api_implementation.rb +18 -0
  7. data/lib/playwright/channel.rb +7 -0
  8. data/lib/playwright/channel_owner.rb +6 -7
  9. data/lib/playwright/channel_owners/android.rb +10 -1
  10. data/lib/playwright/channel_owners/android_device.rb +163 -0
  11. data/lib/playwright/channel_owners/browser.rb +14 -14
  12. data/lib/playwright/channel_owners/browser_context.rb +10 -2
  13. data/lib/playwright/channel_owners/download.rb +27 -0
  14. data/lib/playwright/channel_owners/element_handle.rb +243 -1
  15. data/lib/playwright/channel_owners/frame.rb +269 -22
  16. data/lib/playwright/channel_owners/js_handle.rb +51 -0
  17. data/lib/playwright/channel_owners/page.rb +379 -34
  18. data/lib/playwright/channel_owners/request.rb +9 -1
  19. data/lib/playwright/channel_owners/webkit_browser.rb +1 -1
  20. data/lib/playwright/connection.rb +9 -6
  21. data/lib/playwright/errors.rb +2 -2
  22. data/lib/playwright/event_emitter.rb +8 -1
  23. data/lib/playwright/event_emitter_proxy.rb +49 -0
  24. data/lib/playwright/file_chooser_impl.rb +23 -0
  25. data/lib/playwright/http_headers.rb +20 -0
  26. data/lib/playwright/input_files.rb +42 -0
  27. data/lib/playwright/javascript/expression.rb +15 -0
  28. data/lib/playwright/javascript/function.rb +15 -0
  29. data/lib/playwright/javascript/value_parser.rb +1 -1
  30. data/lib/playwright/javascript/value_serializer.rb +11 -11
  31. data/lib/playwright/{input_types/keyboard.rb → keyboard_impl.rb} +6 -2
  32. data/lib/playwright/mouse_impl.rb +7 -0
  33. data/lib/playwright/playwright_api.rb +66 -19
  34. data/lib/playwright/select_option_values.rb +42 -0
  35. data/lib/playwright/timeout_settings.rb +1 -1
  36. data/lib/playwright/touchscreen_impl.rb +7 -0
  37. data/lib/playwright/utils.rb +18 -0
  38. data/lib/playwright/version.rb +1 -1
  39. data/lib/playwright/wait_helper.rb +1 -1
  40. data/lib/playwright_api/android.rb +32 -0
  41. data/lib/playwright_api/android_device.rb +77 -0
  42. data/lib/playwright_api/android_input.rb +25 -0
  43. data/lib/playwright_api/binding_call.rb +10 -6
  44. data/lib/playwright_api/browser.rb +22 -22
  45. data/lib/playwright_api/browser_context.rb +31 -22
  46. data/lib/playwright_api/browser_type.rb +16 -56
  47. data/lib/playwright_api/chromium_browser_context.rb +10 -8
  48. data/lib/playwright_api/console_message.rb +9 -10
  49. data/lib/playwright_api/dialog.rb +7 -3
  50. data/lib/playwright_api/download.rb +28 -11
  51. data/lib/playwright_api/element_handle.rb +139 -127
  52. data/lib/playwright_api/file_chooser.rb +17 -9
  53. data/lib/playwright_api/frame.rb +148 -148
  54. data/lib/playwright_api/js_handle.rb +26 -22
  55. data/lib/playwright_api/keyboard.rb +6 -6
  56. data/lib/playwright_api/page.rb +215 -179
  57. data/lib/playwright_api/playwright.rb +34 -46
  58. data/lib/playwright_api/request.rb +7 -8
  59. data/lib/playwright_api/response.rb +10 -6
  60. data/lib/playwright_api/selectors.rb +13 -9
  61. data/lib/playwright_api/web_socket.rb +10 -1
  62. data/lib/playwright_api/worker.rb +13 -13
  63. data/playwright.gemspec +1 -0
  64. metadata +32 -6
  65. data/lib/playwright/input_type.rb +0 -19
  66. data/lib/playwright/input_types/mouse.rb +0 -4
  67. data/lib/playwright/input_types/touchscreen.rb +0 -4
@@ -0,0 +1,42 @@
1
+ module Playwright
2
+ class SelectOptionValues
3
+ def initialize(element: nil, index: nil, value: nil, label: nil)
4
+ @params =
5
+ if element
6
+ convert(elmeent)
7
+ elsif index
8
+ convert(index)
9
+ elsif value
10
+ convert(value)
11
+ elsif label
12
+ convert(label)
13
+ else
14
+ {}
15
+ end
16
+ end
17
+
18
+ # @return [Hash]
19
+ def as_params
20
+ @params
21
+ end
22
+
23
+ private def convert(values)
24
+ return convert([values]) unless values.is_a?(Enumerable)
25
+ return {} if values.empty?
26
+ values.each_with_index do |value, index|
27
+ unless values
28
+ raise ArgumentError.new("options[#{index}]: expected object, got null")
29
+ end
30
+ end
31
+
32
+ case values.first
33
+ when ElementHandle
34
+ { elements: values.map(&:channel) }
35
+ when String
36
+ { options: values.map { |value| { value: value } } }
37
+ else
38
+ { options: values }
39
+ end
40
+ end
41
+ end
42
+ end
@@ -13,7 +13,7 @@ module Playwright
13
13
  end
14
14
 
15
15
  def timeout
16
- @default_timeout || @parent&.navigation_timeout || DEFAULT_TIMEOUT
16
+ @default_timeout || @parent&.timeout || DEFAULT_TIMEOUT
17
17
  end
18
18
  end
19
19
  end
@@ -0,0 +1,7 @@
1
+ module Playwright
2
+ define_api_implementation :TouchscreenImpl do
3
+ def initialize(channel)
4
+ @channel = channel
5
+ end
6
+ end
7
+ end
@@ -1,5 +1,23 @@
1
1
  module Playwright
2
2
  module Utils
3
+ module PrepareBrowserContextOptions
4
+ # @see https://github.com/microsoft/playwright/blob/5a2cfdbd47ed3c3deff77bb73e5fac34241f649d/src/client/browserContext.ts#L265
5
+ private def prepare_browser_context_options(params)
6
+ if params[:noViewport] == 0
7
+ params.delete(:noViewport)
8
+ params[:noDefaultViewport] = true
9
+ end
10
+ if params[:extraHTTPHeaders]
11
+ params[:extraHTTPHeaders] = ::Playwright::HttpHeaders.new(params[:extraHTTPHeaders]).as_serialized
12
+ end
13
+ if params[:storageState].is_a?(String)
14
+ params[:storageState] = JSON.parse(File.read(params[:storageState]))
15
+ end
16
+
17
+ params
18
+ end
19
+ end
20
+
3
21
  module Errors
4
22
  module SafeCloseError
5
23
  # @param err [Exception]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playwright
4
- VERSION = '0.0.6'
4
+ VERSION = '0.2.0'
5
5
  end
@@ -23,7 +23,7 @@ module Playwright
23
23
  return if timeout_ms <= 0
24
24
 
25
25
  Concurrent::Promises.schedule(timeout_ms / 1000.0) {
26
- reject(TimeoutError.new(message))
26
+ reject(TimeoutError.new(message: message))
27
27
  }
28
28
 
29
29
  self
@@ -0,0 +1,32 @@
1
+ module Playwright
2
+ # @nodoc
3
+ class Android < PlaywrightApi
4
+
5
+ # @nodoc
6
+ def devices
7
+ wrap_impl(@impl.devices)
8
+ end
9
+
10
+ # -- inherited from EventEmitter --
11
+ # @nodoc
12
+ def once(event, callback)
13
+ event_emitter_proxy.once(event, callback)
14
+ end
15
+
16
+ # -- inherited from EventEmitter --
17
+ # @nodoc
18
+ def on(event, callback)
19
+ event_emitter_proxy.on(event, callback)
20
+ end
21
+
22
+ # -- inherited from EventEmitter --
23
+ # @nodoc
24
+ def off(event, callback)
25
+ event_emitter_proxy.off(event, callback)
26
+ end
27
+
28
+ private def event_emitter_proxy
29
+ @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,77 @@
1
+ module Playwright
2
+ # @nodoc
3
+ class AndroidDevice < PlaywrightApi
4
+
5
+ # @nodoc
6
+ def tree
7
+ wrap_impl(@impl.tree)
8
+ end
9
+
10
+ # @nodoc
11
+ def close
12
+ wrap_impl(@impl.close)
13
+ end
14
+
15
+ # @nodoc
16
+ def tap_on(selector, duration: nil, timeout: nil)
17
+ wrap_impl(@impl.tap_on(unwrap_impl(selector), duration: unwrap_impl(duration), timeout: unwrap_impl(timeout)))
18
+ end
19
+
20
+ # @nodoc
21
+ def screenshot(path: nil)
22
+ wrap_impl(@impl.screenshot(path: unwrap_impl(path)))
23
+ end
24
+
25
+ # @nodoc
26
+ def shell(command)
27
+ wrap_impl(@impl.shell(unwrap_impl(command)))
28
+ end
29
+
30
+ # @nodoc
31
+ def input
32
+ wrap_impl(@impl.input)
33
+ end
34
+
35
+ # @nodoc
36
+ def launch_browser(pkg: nil, acceptDownloads: nil, bypassCSP: nil, colorScheme: nil, deviceScaleFactor: nil, extraHTTPHeaders: nil, geolocation: nil, hasTouch: nil, httpCredentials: nil, ignoreHTTPSErrors: nil, isMobile: nil, javaScriptEnabled: nil, locale: nil, noViewport: nil, offline: nil, permissions: nil, proxy: nil, record_har_omit_content: nil, record_har_path: nil, record_video_dir: nil, record_video_size: nil, storageState: nil, timezoneId: nil, userAgent: nil, viewport: nil, &block)
37
+ wrap_impl(@impl.launch_browser(pkg: unwrap_impl(pkg), acceptDownloads: unwrap_impl(acceptDownloads), bypassCSP: unwrap_impl(bypassCSP), colorScheme: unwrap_impl(colorScheme), deviceScaleFactor: unwrap_impl(deviceScaleFactor), extraHTTPHeaders: unwrap_impl(extraHTTPHeaders), geolocation: unwrap_impl(geolocation), hasTouch: unwrap_impl(hasTouch), httpCredentials: unwrap_impl(httpCredentials), ignoreHTTPSErrors: unwrap_impl(ignoreHTTPSErrors), isMobile: unwrap_impl(isMobile), javaScriptEnabled: unwrap_impl(javaScriptEnabled), locale: unwrap_impl(locale), noViewport: unwrap_impl(noViewport), offline: unwrap_impl(offline), permissions: unwrap_impl(permissions), proxy: unwrap_impl(proxy), record_har_omit_content: unwrap_impl(record_har_omit_content), record_har_path: unwrap_impl(record_har_path), record_video_dir: unwrap_impl(record_video_dir), record_video_size: unwrap_impl(record_video_size), storageState: unwrap_impl(storageState), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
38
+ end
39
+
40
+ # @nodoc
41
+ def info(selector)
42
+ wrap_impl(@impl.info(unwrap_impl(selector)))
43
+ end
44
+
45
+ # @nodoc
46
+ def serial
47
+ wrap_impl(@impl.serial)
48
+ end
49
+
50
+ # @nodoc
51
+ def model
52
+ wrap_impl(@impl.model)
53
+ end
54
+
55
+ # -- inherited from EventEmitter --
56
+ # @nodoc
57
+ def once(event, callback)
58
+ event_emitter_proxy.once(event, callback)
59
+ end
60
+
61
+ # -- inherited from EventEmitter --
62
+ # @nodoc
63
+ def on(event, callback)
64
+ event_emitter_proxy.on(event, callback)
65
+ end
66
+
67
+ # -- inherited from EventEmitter --
68
+ # @nodoc
69
+ def off(event, callback)
70
+ event_emitter_proxy.off(event, callback)
71
+ end
72
+
73
+ private def event_emitter_proxy
74
+ @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,25 @@
1
+ module Playwright
2
+ # @nodoc
3
+ class AndroidInput < PlaywrightApi
4
+
5
+ # @nodoc
6
+ def type(text)
7
+ wrap_impl(@impl.type(unwrap_impl(text)))
8
+ end
9
+
10
+ # @nodoc
11
+ def tap_point(point)
12
+ wrap_impl(@impl.tap_point(unwrap_impl(point)))
13
+ end
14
+
15
+ # @nodoc
16
+ def drag(from, to, steps)
17
+ wrap_impl(@impl.drag(unwrap_impl(from), unwrap_impl(to), unwrap_impl(steps)))
18
+ end
19
+
20
+ # @nodoc
21
+ def press(key)
22
+ wrap_impl(@impl.press(unwrap_impl(key)))
23
+ end
24
+ end
25
+ end
@@ -4,20 +4,24 @@ module Playwright
4
4
 
5
5
  # -- inherited from EventEmitter --
6
6
  # @nodoc
7
- def on(event, callback)
8
- wrap_impl(@impl.on(event, callback))
7
+ def once(event, callback)
8
+ event_emitter_proxy.once(event, callback)
9
9
  end
10
10
 
11
11
  # -- inherited from EventEmitter --
12
12
  # @nodoc
13
- def off(event, callback)
14
- wrap_impl(@impl.off(event, callback))
13
+ def on(event, callback)
14
+ event_emitter_proxy.on(event, callback)
15
15
  end
16
16
 
17
17
  # -- inherited from EventEmitter --
18
18
  # @nodoc
19
- def once(event, callback)
20
- wrap_impl(@impl.once(event, callback))
19
+ def off(event, callback)
20
+ event_emitter_proxy.off(event, callback)
21
+ end
22
+
23
+ private def event_emitter_proxy
24
+ @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
21
25
  end
22
26
  end
23
27
  end
@@ -1,7 +1,7 @@
1
1
  module Playwright
2
2
  # - extends: [EventEmitter]
3
3
  #
4
- # A Browser is created via [`method: BrowserType.launch`]. An example of using a `Browser` to create a [Page]:
4
+ # A Browser is created via [`method: BrowserType.launch`]. An example of using a `Browser` to create a `Page`:
5
5
  #
6
6
  #
7
7
  # ```js
@@ -135,19 +135,20 @@ module Playwright
135
135
  isMobile: nil,
136
136
  javaScriptEnabled: nil,
137
137
  locale: nil,
138
- logger: nil,
138
+ noViewport: nil,
139
139
  offline: nil,
140
140
  permissions: nil,
141
141
  proxy: nil,
142
- recordHar: nil,
143
- recordVideo: nil,
142
+ record_har_omit_content: nil,
143
+ record_har_path: nil,
144
+ record_video_dir: nil,
145
+ record_video_size: nil,
144
146
  storageState: nil,
145
147
  timezoneId: nil,
146
148
  userAgent: nil,
147
- videoSize: nil,
148
- videosPath: nil,
149
- viewport: nil)
150
- wrap_impl(@impl.new_context(acceptDownloads: acceptDownloads, bypassCSP: bypassCSP, colorScheme: colorScheme, deviceScaleFactor: deviceScaleFactor, extraHTTPHeaders: extraHTTPHeaders, geolocation: geolocation, hasTouch: hasTouch, httpCredentials: httpCredentials, ignoreHTTPSErrors: ignoreHTTPSErrors, isMobile: isMobile, javaScriptEnabled: javaScriptEnabled, locale: locale, logger: logger, offline: offline, permissions: permissions, proxy: proxy, recordHar: recordHar, recordVideo: recordVideo, storageState: storageState, timezoneId: timezoneId, userAgent: userAgent, videoSize: videoSize, videosPath: videosPath, viewport: viewport))
149
+ viewport: nil,
150
+ &block)
151
+ wrap_impl(@impl.new_context(acceptDownloads: unwrap_impl(acceptDownloads), bypassCSP: unwrap_impl(bypassCSP), colorScheme: unwrap_impl(colorScheme), deviceScaleFactor: unwrap_impl(deviceScaleFactor), extraHTTPHeaders: unwrap_impl(extraHTTPHeaders), geolocation: unwrap_impl(geolocation), hasTouch: unwrap_impl(hasTouch), httpCredentials: unwrap_impl(httpCredentials), ignoreHTTPSErrors: unwrap_impl(ignoreHTTPSErrors), isMobile: unwrap_impl(isMobile), javaScriptEnabled: unwrap_impl(javaScriptEnabled), locale: unwrap_impl(locale), noViewport: unwrap_impl(noViewport), offline: unwrap_impl(offline), permissions: unwrap_impl(permissions), proxy: unwrap_impl(proxy), record_har_omit_content: unwrap_impl(record_har_omit_content), record_har_path: unwrap_impl(record_har_path), record_video_dir: unwrap_impl(record_video_dir), record_video_size: unwrap_impl(record_video_size), storageState: unwrap_impl(storageState), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
151
152
  end
152
153
 
153
154
  # Creates a new page in a new browser context. Closing this page will close the context as well.
@@ -168,19 +169,19 @@ module Playwright
168
169
  isMobile: nil,
169
170
  javaScriptEnabled: nil,
170
171
  locale: nil,
171
- logger: nil,
172
+ noViewport: nil,
172
173
  offline: nil,
173
174
  permissions: nil,
174
175
  proxy: nil,
175
- recordHar: nil,
176
- recordVideo: nil,
176
+ record_har_omit_content: nil,
177
+ record_har_path: nil,
178
+ record_video_dir: nil,
179
+ record_video_size: nil,
177
180
  storageState: nil,
178
181
  timezoneId: nil,
179
182
  userAgent: nil,
180
- videoSize: nil,
181
- videosPath: nil,
182
183
  viewport: nil)
183
- wrap_impl(@impl.new_page(acceptDownloads: acceptDownloads, bypassCSP: bypassCSP, colorScheme: colorScheme, deviceScaleFactor: deviceScaleFactor, extraHTTPHeaders: extraHTTPHeaders, geolocation: geolocation, hasTouch: hasTouch, httpCredentials: httpCredentials, ignoreHTTPSErrors: ignoreHTTPSErrors, isMobile: isMobile, javaScriptEnabled: javaScriptEnabled, locale: locale, logger: logger, offline: offline, permissions: permissions, proxy: proxy, recordHar: recordHar, recordVideo: recordVideo, storageState: storageState, timezoneId: timezoneId, userAgent: userAgent, videoSize: videoSize, videosPath: videosPath, viewport: viewport))
184
+ wrap_impl(@impl.new_page(acceptDownloads: unwrap_impl(acceptDownloads), bypassCSP: unwrap_impl(bypassCSP), colorScheme: unwrap_impl(colorScheme), deviceScaleFactor: unwrap_impl(deviceScaleFactor), extraHTTPHeaders: unwrap_impl(extraHTTPHeaders), geolocation: unwrap_impl(geolocation), hasTouch: unwrap_impl(hasTouch), httpCredentials: unwrap_impl(httpCredentials), ignoreHTTPSErrors: unwrap_impl(ignoreHTTPSErrors), isMobile: unwrap_impl(isMobile), javaScriptEnabled: unwrap_impl(javaScriptEnabled), locale: unwrap_impl(locale), noViewport: unwrap_impl(noViewport), offline: unwrap_impl(offline), permissions: unwrap_impl(permissions), proxy: unwrap_impl(proxy), record_har_omit_content: unwrap_impl(record_har_omit_content), record_har_path: unwrap_impl(record_har_path), record_video_dir: unwrap_impl(record_video_dir), record_video_size: unwrap_impl(record_video_size), storageState: unwrap_impl(storageState), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), viewport: unwrap_impl(viewport)))
184
185
  end
185
186
 
186
187
  # Returns the browser version.
@@ -188,27 +189,26 @@ module Playwright
188
189
  wrap_impl(@impl.version)
189
190
  end
190
191
 
192
+ # -- inherited from EventEmitter --
191
193
  # @nodoc
192
- def after_initialize
193
- wrap_impl(@impl.after_initialize)
194
+ def once(event, callback)
195
+ event_emitter_proxy.once(event, callback)
194
196
  end
195
197
 
196
198
  # -- inherited from EventEmitter --
197
199
  # @nodoc
198
200
  def on(event, callback)
199
- wrap_impl(@impl.on(event, callback))
201
+ event_emitter_proxy.on(event, callback)
200
202
  end
201
203
 
202
204
  # -- inherited from EventEmitter --
203
205
  # @nodoc
204
206
  def off(event, callback)
205
- wrap_impl(@impl.off(event, callback))
207
+ event_emitter_proxy.off(event, callback)
206
208
  end
207
209
 
208
- # -- inherited from EventEmitter --
209
- # @nodoc
210
- def once(event, callback)
211
- wrap_impl(@impl.once(event, callback))
210
+ private def event_emitter_proxy
211
+ @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
212
212
  end
213
213
  end
214
214
  end
@@ -96,7 +96,7 @@ module Playwright
96
96
  #
97
97
  # > NOTE: The order of evaluation of multiple scripts installed via [`method: BrowserContext.addInitScript`] and
98
98
  # [`method: Page.addInitScript`] is not defined.
99
- def add_init_script(script, arg: nil)
99
+ def add_init_script(path: nil, script: nil)
100
100
  raise NotImplementedError.new('add_init_script is not implemented yet.')
101
101
  end
102
102
 
@@ -523,12 +523,6 @@ module Playwright
523
523
  end
524
524
  alias_method :geolocation=, :set_geolocation
525
525
 
526
- # **DEPRECATED** Browsers may cache credentials after successful authentication. Create a new browser context instead.
527
- def set_http_credentials(httpCredentials)
528
- raise NotImplementedError.new('set_http_credentials is not implemented yet.')
529
- end
530
- alias_method :http_credentials=, :set_http_credentials
531
-
532
526
  def set_offline(offline)
533
527
  raise NotImplementedError.new('set_offline is not implemented yet.')
534
528
  end
@@ -567,46 +561,61 @@ module Playwright
567
561
  # page.click("button")
568
562
  # page = event_info.value
569
563
  # ```
570
- def expect_event(event, optionsOrPredicate: nil)
564
+ def expect_event(event, predicate: nil, timeout: nil)
571
565
  raise NotImplementedError.new('expect_event is not implemented yet.')
572
566
  end
573
567
 
574
- # @nodoc
575
- def owner_page=(req)
576
- wrap_impl(@impl.owner_page=(req))
568
+ # Performs action and waits for `page` event to fire. If predicate is provided, it passes `Page` value into the
569
+ # `predicate` function and waits for `predicate(event)` to return a truthy value. Will throw an error if the page is
570
+ # closed before the worker event is fired.
571
+ def expect_page(predicate: nil, timeout: nil)
572
+ raise NotImplementedError.new('expect_page is not implemented yet.')
577
573
  end
578
574
 
579
- # @nodoc
580
- def after_initialize
581
- wrap_impl(@impl.after_initialize)
575
+ # > NOTE: In most cases, you should use [`method: BrowserContext.waitForEvent`].
576
+ #
577
+ # Waits for given `event` to fire. If predicate is provided, it passes event's value into the `predicate` function and
578
+ # waits for `predicate(event)` to return a truthy value. Will throw an error if the socket is closed before the `event` is
579
+ # fired.
580
+ def wait_for_event(event, predicate: nil, timeout: nil)
581
+ raise NotImplementedError.new('wait_for_event is not implemented yet.')
582
582
  end
583
583
 
584
584
  # @nodoc
585
585
  def browser=(req)
586
- wrap_impl(@impl.browser=(req))
586
+ wrap_impl(@impl.browser=(unwrap_impl(req)))
587
+ end
588
+
589
+ # @nodoc
590
+ def owner_page=(req)
591
+ wrap_impl(@impl.owner_page=(unwrap_impl(req)))
587
592
  end
588
593
 
589
594
  # @nodoc
590
595
  def options=(req)
591
- wrap_impl(@impl.options=(req))
596
+ wrap_impl(@impl.options=(unwrap_impl(req)))
592
597
  end
593
598
 
594
599
  # -- inherited from EventEmitter --
595
600
  # @nodoc
596
- def on(event, callback)
597
- wrap_impl(@impl.on(event, callback))
601
+ def once(event, callback)
602
+ event_emitter_proxy.once(event, callback)
598
603
  end
599
604
 
600
605
  # -- inherited from EventEmitter --
601
606
  # @nodoc
602
- def off(event, callback)
603
- wrap_impl(@impl.off(event, callback))
607
+ def on(event, callback)
608
+ event_emitter_proxy.on(event, callback)
604
609
  end
605
610
 
606
611
  # -- inherited from EventEmitter --
607
612
  # @nodoc
608
- def once(event, callback)
609
- wrap_impl(@impl.once(event, callback))
613
+ def off(event, callback)
614
+ event_emitter_proxy.off(event, callback)
615
+ end
616
+
617
+ private def event_emitter_proxy
618
+ @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
610
619
  end
611
620
  end
612
621
  end