Bug
1864254 [wpt PR 43094] - serial: Fix DCHECK crash when disconnection happens during abort, a=testonly
Automatic update from web-platform-tests
serial: Fix DCHECK crash when disconnection happens during abort
The original implementation of
`SerialPortUnderlyingSink::OnFlushOrDrain` assumed that a valid
`pending_operation_` would always be available. However, this assumption
was flawed as disconnection could occur before the completion of the
abort operation.
To address this issue, the serialPort-disconnect-during-abort test was
introduced to trigger the crash and demonstrate that the disconnection
handler cleared pending_operation_. The revised code now checks the validity of `pending_operation_` before attempting to resolve it.
This modification ensures that
`SerialPortUnderlyingSink::OnFlushOrDrain` correctly even when
disconnection occurs during an abort operation, preventing potential
crashes.
Bug:
1499045
Change-Id: I5e09595063f8b18f8ff1da82ab23d1b21afdc6d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/
5021930
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Alvin Ji <alvinji@chromium.org>
Commit-Queue: Alvin Ji <alvinji@chromium.org>
Cr-Commit-Position: refs/heads/main@{#
1227040}
--
wpt-commits:
efde45b53b8fe9e66ac59dbe38ac8b34d568f67c
wpt-pr: 43094