Closed Bug 1915764 Opened 6 months ago Closed 6 months ago

[wpt-sync] Sync PR 47881 - DOM: Fix `Observable#from()` [Symbol.iterator] semantics (1/2)

Categories

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

task

Tracking

()

RESOLVED FIXED
131 Branch
Tracking Status
firefox131 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Dominic Farolino <dom@chromium.org> wrote:

DOM: Fix Observable#from() [Symbol.iterator] semantics (1/2)

See https://github.com/WICG/observable/pull/160, which specs the
Observable#from() semantics, matching these tests. See also
https://crbug.com/363015168 which describes the ways in which our
current implementation of Observable#from()'s detection semantics
are overbroad.

This CL makes the implementation of the "detection semantics" match the
desired behavior outlined in that issue, and adds a bunch of tests.

R=masonf@chromium.org

Bug: 363015168, 40282760
Change-Id: Id6cfdd45c44286b298e107635e4283b018f50aaf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5824955
Commit-Queue: Dominic Farolino \<dom@chromium.org>
Reviewed-by: Mason Freed \<masonf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1349019}

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core

CI Results

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

Total 2 tests and 18 subtests

Status Summary

Firefox

OK : 2
FAIL: 36

Chrome

OK : 2
PASS: 30
FAIL: 6

Safari

OK : 2
FAIL: 36

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /dom/observable/tentative/observable-from.any.html [wpt.fyi]
    • from(): Observable.from() is a function: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): Failed conversions: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): Given an observable, it returns that exact observable: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): Given an array: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): Iterable converts to Observable: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): [Symbol.iterator] side-effects (one observable): FAIL (Chrome: FAIL, Safari: FAIL)
    • from(): [Symbol.iterator] not callable: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): [Symbol.iterator] is not cached: FAIL (Chrome: FAIL, Safari: FAIL)
    • from(): [Symbol.iterator] side-effects (many observables): FAIL (Chrome: FAIL, Safari: FAIL)
    • from(): [Symbol.iterator] next() throws error: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): Converts Promise to Observable: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): Converts rejected Promise to Observable. No unhandledrejection event when error is handled by subscription: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): Rejections not handled by subscription are reported to the global, and still not sent as an unhandledrejection event: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): Observable that implements @@iterator protocol gets converted as an Observable, not iterator: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): Promise that implements @@iterator protocol gets converted as an iterable, not Promise: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): Promise whose [Symbol.iterator] returns null converts as Promise: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): Rethrows the error when Converting an object whose @@iterator method getter throws an error: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): Throws 'callable' error when @@iterator property is a non-callable primitive: FAIL (Chrome: PASS, Safari: FAIL)
  • /dom/observable/tentative/observable-from.any.worker.html [wpt.fyi]
    • from(): Observable.from() is a function: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): Failed conversions: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): Given an observable, it returns that exact observable: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): Given an array: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): Iterable converts to Observable: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): [Symbol.iterator] side-effects (one observable): FAIL (Chrome: FAIL, Safari: FAIL)
    • from(): [Symbol.iterator] not callable: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): [Symbol.iterator] is not cached: FAIL (Chrome: FAIL, Safari: FAIL)
    • from(): [Symbol.iterator] side-effects (many observables): FAIL (Chrome: FAIL, Safari: FAIL)
    • from(): [Symbol.iterator] next() throws error: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): Converts Promise to Observable: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): Converts rejected Promise to Observable. No unhandledrejection event when error is handled by subscription: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): Rejections not handled by subscription are reported to the global, and still not sent as an unhandledrejection event: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): Observable that implements @@iterator protocol gets converted as an Observable, not iterator: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): Promise that implements @@iterator protocol gets converted as an iterable, not Promise: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): Promise whose [Symbol.iterator] returns null converts as Promise: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): Rethrows the error when Converting an object whose @@iterator method getter throws an error: FAIL (Chrome: PASS, Safari: FAIL)
    • from(): Throws 'callable' error when @@iterator property is a non-callable primitive: FAIL (Chrome: PASS, Safari: FAIL)
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ef2aac8ce3d8 [wpt PR 47881] - DOM: Fix `Observable#from()` [Symbol.iterator] semantics (1/2), a=testonly https://hg.mozilla.org/integration/autoland/rev/c35ceb99a6c7 [wpt PR 47881] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 131 Branch
You need to log in before you can comment on or make changes to this bug.