DOM: Add more Observable iterable tests #50338
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This CL adds and supplements a few tests:
Specifically, we expand their assertions to not only assert that
next()
isn't ever called, but make more assertions about theiterator protocol getter and function invocations in general.
next()
is not calledwhen 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).
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}