wake lock: Account for lost Mojo connection in MockWakeLock::WaitForCancelation()
WakeLockTest.LossOfDocumentActivity has been flaky since r803272 ("[HeapMojo] Make HeapMojoWrapperMode::kWithContextObserver default"), but that CL simply uncovered a bug in MockWakeLock: when the ExecutionContext is destroyed, MockWakeLock::OnConnectionError() may be called before we call MockWakeLock::WaitForCancelation(), in which case the latter will loop forever. Bail out early if |receiver_| is not bound, which indicates that there has been a Mojo connection error and MockWakeLock::CancelWakeLock() has already been called. Bug: 1123879 Change-Id: Ia2f29fe560a3d7ca49b083dfec01fdcd6c48a504 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2390065 Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> Commit-Queue: Kouhei Ueno <kouhei@chromium.org> Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> Reviewed-by:Kouhei Ueno <kouhei@chromium.org> Reviewed-by:
Minoru Chikamune <chikamune@chromium.org> Cr-Commit-Position: refs/heads/master@{#803852}
Showing
Please register or sign in to comment