From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- .../tests/browser/scroll/browser_test_scrollTo.js | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 accessible/tests/browser/scroll/browser_test_scrollTo.js (limited to 'accessible/tests/browser/scroll/browser_test_scrollTo.js') diff --git a/accessible/tests/browser/scroll/browser_test_scrollTo.js b/accessible/tests/browser/scroll/browser_test_scrollTo.js new file mode 100644 index 0000000000..43a230b7b8 --- /dev/null +++ b/accessible/tests/browser/scroll/browser_test_scrollTo.js @@ -0,0 +1,36 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +/** + * Test nsIAccessible::scrollTo. + */ +addAccessibleTask( + ` +
+

a

+

b

+
+ `, + async function (browser, docAcc) { + const scroller = findAccessibleChildByID(docAcc, "scroller"); + // scroller can only fit one of p1 or p2, not both. + // p1 is on screen already. + const p2 = findAccessibleChildByID(docAcc, "p2"); + info("scrollTo p2"); + let scrolled = waitForEvent( + nsIAccessibleEvent.EVENT_SCROLLING_END, + scroller + ); + p2.scrollTo(SCROLL_TYPE_ANYWHERE); + await scrolled; + const p1 = findAccessibleChildByID(docAcc, "p1"); + info("scrollTo p1"); + scrolled = waitForEvent(nsIAccessibleEvent.EVENT_SCROLLING_END, scroller); + p1.scrollTo(SCROLL_TYPE_ANYWHERE); + await scrolled; + }, + { topLevel: true, iframe: true, remoteIframe: true, chrome: true } +); -- cgit v1.2.3