Skip to content

Add some tests related to GPUDevice extending EventTarget #4389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

greggman
Copy link
Contributor

@greggman greggman commented May 15, 2025

  • Test you can pass Event and CustomEvent through GPUDevice.
  • Test if you override a method on EventTarget it's called when you call the corresponding method on GPUDevice.
  • Test if you can pass GPUUncapturedErrorEvent through an EventTarget that is not GPUDevice

These pass on Chrome, Firefox, and Safari. dawn.node fails these tests though I have a patch that makes it work.

Note: I made Fixture.expect take a function. If function was passed and no msg was provided then it uses the source of the function as the string. This makes it nice for small tests to see what passed/failed. Without this all you get is OK/FAIL and you need to provide a message.

Example:

Screenshot 2025-05-15 at 16 07 56

wdyt?

* Test you can pass Event and CustomEvent through GPUDevice.
* Test if you override a method on EventTarget it's called
  when you call the corresponding method on GPUDevice.
* Test if you can pass GPUUncapturedErrorEvent through an
  EventTarget that is not GPUDevice

Note: dawn.node fails these tests. It's not clear if NAPI makes
this possible at all :(
@greggman greggman requested a review from kainino0x May 15, 2025 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant