Skip to content
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

DOM: Add more Observable iterable tests #50338

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

This CL adds and supplements a few tests:

  1. First we modify the existing "subscribe with aborted signal" tests.
    Specifically, we expand their assertions to not only assert that
    next() isn't ever called, but make more assertions about the
    iterator protocol getter and function invocations in general.
  2. Second, we modify the test that asserts next() is not called
    when you subscribe with an unaborted signal, but that signal gets
    aborted while the iterator protocol methods are called during
    subscription of the Observable. We expand the assertions in the
    same way as (1), and combine the two separate tests into one that
    covers both sync and async iterators, also to match (1).
  3. Finally, this CL adds a sync iterable version of the test added in
    https://crrev.com/c/6199630. The test scenario is: you subscribe to
    a sync iterable with an unaborted signal that gets aborted while
    obtaining the iterator (just like (2)), BUT while getting the
    iterator, an error is thrown. The tests asserts that the error is
    reported to the global before we consult the aborted signal and
    stop the subscription process. This ensures that the exception is
    not swallowed, but is appropriately surfaced, even though the
    subscription is aborted.

This corresponds with the spec PR:
WICG/observable#192.

R=masonf

Bug: 363015168
Change-Id: Ida605c49a2d73cd407a9dc3c392d6b2f338855be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6202182
Commit-Queue: Dominic Farolino <[email protected]>
Reviewed-by: Mason Freed <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1412315}

This CL adds and supplements a few tests:

  1. First we modify the existing "subscribe with aborted signal" tests.
     Specifically, we expand their assertions to not only assert that
     `next()` isn't ever called, but make more assertions about the
     iterator protocol getter and function invocations in general.
  2. Second, we modify the test that asserts `next()` is not called
     when you subscribe with an unaborted signal, but that signal gets
     aborted while the iterator protocol methods are called during
     subscription of the Observable. We expand the assertions in the
     same way as (1), and combine the two separate tests into one that
     covers both sync and async iterators, also to match (1).
  3. Finally, this CL adds a sync iterable version of the test added in
     https://crrev.com/c/6199630. The test scenario is: you subscribe to
     a sync iterable with an unaborted signal that gets aborted while
     obtaining the iterator (just like (2)), BUT while getting the
     iterator, an error is thrown. The tests asserts that the error is
     reported to the global before we consult the aborted signal and
     stop the subscription process. This ensures that the exception is
     not swallowed, but is appropriately surfaced, even though the
     subscription is aborted.

This corresponds with the spec PR:
WICG/observable#192.

R=masonf

Bug: 363015168
Change-Id: Ida605c49a2d73cd407a9dc3c392d6b2f338855be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6202182
Commit-Queue: Dominic Farolino <[email protected]>
Reviewed-by: Mason Freed <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1412315}
Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot merged commit ea15691 into master Jan 28, 2025
21 checks passed
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-0cd67687c7 branch January 28, 2025 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants