Implement RequestToLockMouse in HeadlessWebContentsImpl::Delegate
There are a few wpt pointerlock tests that fail under the new wpt try bots. The wpt try bots are running wpt run in headless mode. Turns out that, when running wpt tests in headless mode with the wpt runner,the code is reaching this line in WebContentsImpl::RequestToLockMouse [1]. The problem here is that delegate_->RequestToLockMouse is actually the empty implementation from WebContentsDelegate::RequestToLockMouse. This is why the WebContents::GotResponseToLockMouseRequest is never called. The expectation for WebContentsDelegate::RequestToLockMouse is to call WebContents::GotResponseToLockMouseRequest like other code paths. The culprit is HeadlessWebContentsImpl:Delegate, which inherits the empty implementation of WebContentsDelegate::RequestToLockMouse. When running the wpt tests without --headless the delegate is an instance of Browser class. Implement HeadlessWebContentsImpl:Delegate::RequestToLockMouse similar to what we do for content shell. [1] https://www.google.com/url?q=https://source.chromium.org/chromium/chromium/src/%2B/master:content/browser/web_contents/web_contents_impl.cc;drc%3D3fab4813ccc76de821bb74b441ff491afc8a7a6f;l%3D3402&sa=D&source=calendar&ust=1608479687279000&usg=AOvVaw2Q3jZFrFsbSnQd8osPwpOU TEST=external/wpt/pointerevents/pointerlock/pointerevent_getCoalescedEvents_when_pointerlocked.html,external/wpt/pointerevents/pointerlock/pointerevent_coordinates_when_locked.html,external/wpt/pointerevents/pointerlock/pointerevent_getCoalescedEvents_when_pointerlocked.html,external/wpt/pointerevents/pointerlock/pointerevent_movementxy_with_pointerlock.html,external/wpt/pointerevents/pointerlock/pointerevent_pointerlock_after_pointercapture.html,external/wpt/pointerevents/pointerlock/pointerevent_pointermove_in_pointerlock.html,external/wpt/pointerevents/pointerlock/pointerevent_pointermove_on_chorded_mouse_button_when_locked.html Bug: 1127055 Change-Id: Ic1da165fed1dc1902c5e8c0dbb5f7cfc7513ee30 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2594009Reviewed-by:Mustaq Ahmed <mustaq@chromium.org> Reviewed-by:
Peter Kvitek <kvitekp@chromium.org> Commit-Queue: Liviu Tinta <liviutinta@chromium.org> Cr-Commit-Position: refs/heads/master@{#841490}
Showing
Please register or sign in to comment