Closed Bug 1890786 Opened 6 months ago Closed 6 months ago

[wpt-sync] Sync PR 45647 - DOM: Implement `inspect()` Observable operator

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED FIXED
127 Branch
Tracking Status
firefox127 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 45647 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/45647
Details from upstream follow.

Dominic Farolino <dom@chromium.org> wrote:

DOM: Implement inspect() Observable operator

This CL implements the Observable#inspect() operator. Inspect gives a
way to tap into an Observable's outputs. To inspect(), you can provide
the following callbacks:

source
  .inspect({
    next: v => {},
    error: e => {},
    complete: () => {}

    subscribe: () => {}
    abort: reason => {}
  })

These are mostly self-explanatory. The subscribe() callback gets called
just before the source Observable gets subscribed to, and the abort()
handler gets called whenever the Subscriber's signal gets aborted
specifically for consumer-initiated unsubscriptions. That is, the abort
handler will not be invoked when the source Observable calls its
Subscriber#{error(), complete()} methods. It only gets called for
consumer-initiated subscriptions. This is accomplished by adding an
abort algorithm to the inspect() Subscriber's signal, and removing that
algorithm immediately whenever the
SourceInternalObserver#{Error(), Complete()} methods are invoked, so
that the abort() handler callback does not get invoked when these
methods error()/complete() the associated Subscriber.

For WPTs:
Co-authored-by: ben@benlesh.com

R=masonf@chromium.org

Bug: 40282760
Change-Id: Ia9dfc1291c62e6e665656c09499243ea9930c28a
Reviewed-on: https://chromium-review.googlesource.com/5435614
WPT-Export-Revision: 4c863a7d25c38a334fdd2f71d864ae9b6bad1ce4

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 2 tests and 13 subtests

Status Summary

Firefox

OK : 2
FAIL: 26

Chrome

OK : 2
FAIL: 26

Safari

OK : 2
FAIL: 26

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /dom/observable/tentative/observable-inspect.any.html [wpt.fyi]
    • inspect(): Provides a pre-subscription subscribe callback: FAIL (Chrome: FAIL, Safari: FAIL)
    • inspect(): Provides a way to tap into the values and completions of the source observable using an observer: FAIL (Chrome: FAIL, Safari: FAIL)
    • inspect(): Error handler does not stop error from being reported to the global, when subscriber does not pass error handler: FAIL (Chrome: FAIL, Safari: FAIL)
    • inspect(): Provides a way to tap into the values and errors of the source observable using an observer. Errors are passed through: FAIL (Chrome: FAIL, Safari: FAIL)
    • inspect(): ObserverCallback passed in: FAIL (Chrome: FAIL, Safari: FAIL)
    • inspect(): Throwing an error in the observer next handler is caught and sent to the error callback of the result observable: FAIL (Chrome: FAIL, Safari: FAIL)
    • inspect(): Throwing an error in the observer error handler in inspect() is caught and sent to the error callback of the result observable: FAIL (Chrome: FAIL, Safari: FAIL)
    • inspect(): Throwing an error in the observer complete handler is caught and sent to the error callback of the result observable: FAIL (Chrome: FAIL, Safari: FAIL)
    • inspect(): Throwing an error in the next handler function in do should be caught and sent to the error callback of the result observable: FAIL (Chrome: FAIL, Safari: FAIL)
    • inspect(): Errors thrown in subscribe() Inspector handler subscribe handler are caught and sent to error callback: FAIL (Chrome: FAIL, Safari: FAIL)
    • inspect(): Provides a way to tap into the moment a source observable is unsubscribed from: FAIL (Chrome: FAIL, Safari: FAIL)
    • inspect(): Inspector abort() handler is not called if the source completes before the result is unsubscribed from: FAIL (Chrome: FAIL, Safari: FAIL)
    • inspect(): Errors thrown from inspect()'s abort() handler are caught and reported to the global, because the subscription is already closed by the time the handler runs: FAIL (Chrome: FAIL, Safari: FAIL)
  • /dom/observable/tentative/observable-inspect.any.worker.html [wpt.fyi]
    • inspect(): Provides a pre-subscription subscribe callback: FAIL (Chrome: FAIL, Safari: FAIL)
    • inspect(): Provides a way to tap into the values and completions of the source observable using an observer: FAIL (Chrome: FAIL, Safari: FAIL)
    • inspect(): Error handler does not stop error from being reported to the global, when subscriber does not pass error handler: FAIL (Chrome: FAIL, Safari: FAIL)
    • inspect(): Provides a way to tap into the values and errors of the source observable using an observer. Errors are passed through: FAIL (Chrome: FAIL, Safari: FAIL)
    • inspect(): ObserverCallback passed in: FAIL (Chrome: FAIL, Safari: FAIL)
    • inspect(): Throwing an error in the observer next handler is caught and sent to the error callback of the result observable: FAIL (Chrome: FAIL, Safari: FAIL)
    • inspect(): Throwing an error in the observer error handler in inspect() is caught and sent to the error callback of the result observable: FAIL (Chrome: FAIL, Safari: FAIL)
    • inspect(): Throwing an error in the observer complete handler is caught and sent to the error callback of the result observable: FAIL (Chrome: FAIL, Safari: FAIL)
    • inspect(): Throwing an error in the next handler function in do should be caught and sent to the error callback of the result observable: FAIL (Chrome: FAIL, Safari: FAIL)
    • inspect(): Errors thrown in subscribe() Inspector handler subscribe handler are caught and sent to error callback: FAIL (Chrome: FAIL, Safari: FAIL)
    • inspect(): Provides a way to tap into the moment a source observable is unsubscribed from: FAIL (Chrome: FAIL, Safari: FAIL)
    • inspect(): Inspector abort() handler is not called if the source completes before the result is unsubscribed from: FAIL (Chrome: FAIL, Safari: FAIL)
    • inspect(): Errors thrown from inspect()'s abort() handler are caught and reported to the global, because the subscription is already closed by the time the handler runs: FAIL (Chrome: FAIL, Safari: FAIL)
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4c1192810d43 [wpt PR 45647] - DOM: Implement `inspect()` Observable operator, a=testonly https://hg.mozilla.org/integration/autoland/rev/f1c5ae199205 [wpt PR 45647] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 127 Branch
You need to log in before you can comment on or make changes to this bug.