mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-28 04:39:07 -10:00
The reason for the intermittent timeouts wasn't actually in the layoutview but in the computed view instead. It turns out computed view didn't handle selection change during an ongoing update from previous selection change correctly. When layout view was moved to the computed view, it caused more things to happen during selection change which slowed the computed view updates triggering this race condition. Whenever selection changed, the previous update was canceled but the promise that was blocking the inspector-updated event from being emitted was never resolved nor rejected. This together with the fact that the layoutview tests didn't properly wait for the initial update after navigation / reload to finish before they triggered a new upload lead to the inspector update to hang waiting for the inspector-updated event and the test to timeout. These changes fix the issues by rejecting the computed-view updated promise whenever the update is canceled. This unblocks the inspector-updated event to be emitted once the selection change has finished and stops the tests from timing out. MozReview-Commit-ID: H4cakxkm4vX