tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit d22a498564ad98e4e056fa1e459b16bed0f8f836
parent 38d5a5696619ab8405387c4fe01b2c705dab413a
Author: Rohan Raja <roraja@microsoft.com>
Date:   Thu,  9 Oct 2025 20:32:54 +0000

Bug 1992143 [wpt PR 55171] - [Mac][Dnd] Fix flaky scrollbar WPT timeouts due to overlay scrollbars, a=testonly

Automatic update from web-platform-tests
[Mac][Dnd] Fix flaky scrollbar WPT timeouts due to overlay scrollbars

In Mac, the scrollbars are overlay which prevents DND tests over
scrollbar from running. The skipping logic causes timeouts since there
is no promise_test which runs in these cases. This fix adds a no-op
promise test to fix this issue.

Bug: 444752944
Change-Id: Ibd9d3609bd192b4a27835c2a25f4ded2dc7eb8fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6993921
Reviewed-by: Gaston Rodriguez <gastonr@microsoft.com>
Commit-Queue: Rohan Raja <roraja@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1523335}

--

wpt-commits: 8c891e31060acd4688072087b12b45b91eef51b2
wpt-pr: 55171

Diffstat:
Mtesting/web-platform/tests/html/editing/dnd/resources/test-helper.js | 34+++++++++++++++++++---------------
1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/testing/web-platform/tests/html/editing/dnd/resources/test-helper.js b/testing/web-platform/tests/html/editing/dnd/resources/test-helper.js @@ -55,7 +55,7 @@ const movePointerToScrollbar = (element, iframe, scrollbarPosition, actions) => }; const hasHorizontalScrollbar = (element, iframe) => { - if (iframe == undefined) { + if (iframe == undefined) { return element.scrollWidth > element.clientWidth; } // If the element is in an iframe, it will become scrollable if @@ -102,6 +102,8 @@ function dragDropTest(dragElement, dropElement, onDropCallBack, testDescription, // Only verifies drop on scrollbar tests if non-overlay scrollbar is present. // Skips the test on platforms with overlay scrollbars. if (dropPosition !== DropPosition.CENTER && calculateScrollbarThickness() <= 0) { + promise_test(async () => { + }, testDescription + ' (skipped - no scrollbars)'); return; } promise_test((t) => new Promise(async (resolve, reject) => { @@ -135,6 +137,8 @@ function dragDropTestNoDropEvent(dragElement, dropElement, testDescription, // Only verifies drop on scrollbar tests if non-overlay scrollbar is present. // Skips the test on platforms with overlay scrollbars. if (dropPosition !== DropPosition.CENTER && calculateScrollbarThickness() <= 0) { + promise_test(async () => { + }, testDescription + ' (skipped - no scrollbars)'); return; } promise_test((t) => new Promise(async (resolve, reject) => { @@ -163,25 +167,25 @@ function dragDropTestNoDropEvent(dragElement, dropElement, testDescription, } const calculateScrollbarThickness = () => { - var container = document.createElement("div"); - container.style.width = "100px"; - container.style.height = "100px"; - container.style.position = "absolute"; - container.style.visibility = "hidden"; - container.style.overflow = "auto"; + var container = document.createElement("div"); + container.style.width = "100px"; + container.style.height = "100px"; + container.style.position = "absolute"; + container.style.visibility = "hidden"; + container.style.overflow = "auto"; - document.body.appendChild(container); + document.body.appendChild(container); - var widthBefore = container.clientWidth; - var longContent = document.createElement("div"); - longContent.style.height = "1000px"; - container.appendChild(longContent); + var widthBefore = container.clientWidth; + var longContent = document.createElement("div"); + longContent.style.height = "1000px"; + container.appendChild(longContent); - var widthAfter = container.clientWidth; + var widthAfter = container.clientWidth; - container.remove(); + container.remove(); - return widthBefore - widthAfter; + return widthBefore - widthAfter; } // Drop callback used for `dropEffect` tests in `dnd/drop/`. This function