Closed Bug 1764459 Opened 3 years ago Closed 3 years ago

[wpt-sync] Sync PR 33620 - idle-detection: Reject start Promise on abort

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(firefox101 fixed)

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Reilly Grant <reillyg@chromium.org> wrote:

idle-detection: Reject start Promise on abort

This change fixes the IdleDetector interface's start() method so that if
the provided AbortSignal is signaled before the Promise it returns
settles it will reject with the provided abort reason instead.

In addition to violating the specification this scenario created an
internal consistenty error which triggered a DCHECK in Update() but was
otherwise harmless. This issue was introduced by the original change
that moved IdleDetector to use an AbortSignal and made it so that the
resolver_ field was never actually populated with the Promise returned
by start().

Tests have been added to more completely exercise the AbortSignal
behavior.

Bug: 1315755
Change-Id: I394587bddf2e8176ff3f691d7f33e494af364684

Reviewed-on: https://chromium-review.googlesource.com/3582549
WPT-Export-Revision: 11da6febc2fb6d7d8615c3d4f3b755cedad7abca

Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]

CI Results

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

Total 1 tests and 10 subtests

Status Summary

Firefox

ERROR : 1
NOTRUN: 10

Chrome

OK : 1
PASS : 8
FAIL : 2

Safari

ERROR : 1
NOTRUN: 10

Links

GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

/idle-detection/interceptor.https.html: ERROR (Chrome: OK, Safari: ERROR)
start(): NOTRUN (Chrome: PASS, Safari: NOTRUN)
updates once: NOTRUN (Chrome: PASS, Safari: NOTRUN)
updates twice: NOTRUN (Chrome: PASS, Safari: NOTRUN)
locked screen: NOTRUN (Chrome: PASS, Safari: NOTRUN)
IdleDetector.onchange: NOTRUN (Chrome: PASS, Safari: NOTRUN)
Calling start() and abort() multiple times: NOTRUN (Chrome: PASS, Safari: NOTRUN)
Calling abort() before start() makes it fail: NOTRUN (Chrome: PASS, Safari: NOTRUN)
Calling abort() after start() makes it fail: NOTRUN (Chrome: FAIL, Safari: NOTRUN)
A start() that has been aborted can be retried: NOTRUN (Chrome: FAIL, Safari: NOTRUN)
Calling start() after abort(): re-starting monitor.: NOTRUN (Chrome: PASS, Safari: NOTRUN)

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e25b6cf55aa9 [wpt PR 33620] - idle-detection: Reject start Promise on abort, a=testonly
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
You need to log in before you can comment on or make changes to this bug.