From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- accessible/tests/browser/bounds/browser_accessible_moved.js | 8 ++++---- accessible/tests/browser/bounds/browser_caret_rect.js | 2 +- accessible/tests/browser/bounds/browser_test_display_contents.js | 6 +++++- accessible/tests/browser/bounds/browser_test_iframe_transform.js | 4 ++-- accessible/tests/browser/bounds/browser_test_simple_transform.js | 6 +++--- accessible/tests/browser/bounds/browser_test_zoom.js | 6 +++++- accessible/tests/browser/bounds/browser_zero_area.js | 8 ++++---- 7 files changed, 24 insertions(+), 16 deletions(-) (limited to 'accessible/tests/browser/bounds') diff --git a/accessible/tests/browser/bounds/browser_accessible_moved.js b/accessible/tests/browser/bounds/browser_accessible_moved.js index 307c680000..a62f7ad8d0 100644 --- a/accessible/tests/browser/bounds/browser_accessible_moved.js +++ b/accessible/tests/browser/bounds/browser_accessible_moved.js @@ -12,10 +12,10 @@ function assertBoundsNonZero(acc) { let width = {}; let height = {}; acc.getBounds(x, y, width, height); - ok(x.value > 0, "x is non-0"); - ok(y.value > 0, "y is non-0"); - ok(width.value > 0, "width is non-0"); - ok(height.value > 0, "height is non-0"); + Assert.greater(x.value, 0, "x is non-0"); + Assert.greater(y.value, 0, "y is non-0"); + Assert.greater(width.value, 0, "width is non-0"); + Assert.greater(height.value, 0, "height is non-0"); } /** diff --git a/accessible/tests/browser/bounds/browser_caret_rect.js b/accessible/tests/browser/bounds/browser_caret_rect.js index ac0ee3aa50..9f5cac33a5 100644 --- a/accessible/tests/browser/bounds/browser_caret_rect.js +++ b/accessible/tests/browser/bounds/browser_caret_rect.js @@ -46,7 +46,7 @@ async function testCaretRect(browser, docAcc, id, offset) { ); const [caretX, caretY, caretW, caretH] = await getCaretRect(browser, id); if (atEnd) { - ok(caretX > charX.value, "Caret x after last character x"); + Assert.greater(caretX, charX.value, "Caret x after last character x"); } else { is(caretX, charX.value, "Caret x same as character x"); } diff --git a/accessible/tests/browser/bounds/browser_test_display_contents.js b/accessible/tests/browser/bounds/browser_test_display_contents.js index db1bfce178..4111ac5a81 100644 --- a/accessible/tests/browser/bounds/browser_test_display_contents.js +++ b/accessible/tests/browser/bounds/browser_test_display_contents.js @@ -16,7 +16,11 @@ async function testContentBounds(browser, acc) { is(x, expectedX, "Wrong x coordinate of " + prettyAccName); is(y, expectedY, "Wrong y coordinate of " + prettyAccName); is(width, expectedWidth, "Wrong width of " + prettyAccName); - ok(height >= expectedHeight, "Wrong height of " + prettyAccName); + Assert.greaterOrEqual( + height, + expectedHeight, + "Wrong height of " + prettyAccName + ); } async function runTests(browser, accDoc) { diff --git a/accessible/tests/browser/bounds/browser_test_iframe_transform.js b/accessible/tests/browser/bounds/browser_test_iframe_transform.js index a44ab75faf..015d466da9 100644 --- a/accessible/tests/browser/bounds/browser_test_iframe_transform.js +++ b/accessible/tests/browser/bounds/browser_test_iframe_transform.js @@ -68,7 +68,7 @@ function testBoundsWithOffset(browser, iframeDocAcc, id, domElmBounds, offset) { addAccessibleTask( `
hello world
`, - async function (browser, iframeDocAcc, contentDocAcc) { + async function (browser, iframeDocAcc) { ok(iframeDocAcc, "IFRAME document accessible is present"); await testBoundsWithContent(iframeDocAcc, ELEM_ID, browser); @@ -143,7 +143,7 @@ addAccessibleTask( */ addAccessibleTask( `
`, - async function (browser, accDoc, foo) { + async function (browser, accDoc) { const docWidth = () => { let width = {}; accDoc.getBounds({}, {}, width, {}); diff --git a/accessible/tests/browser/bounds/browser_test_simple_transform.js b/accessible/tests/browser/bounds/browser_test_simple_transform.js index 7197968b40..b5cb983e72 100644 --- a/accessible/tests/browser/bounds/browser_test_simple_transform.js +++ b/accessible/tests/browser/bounds/browser_test_simple_transform.js @@ -9,7 +9,7 @@ loadScripts({ name: "role.js", dir: MOCHITESTS_DIR }); // test basic translation addAccessibleTask( `

hello world

`, - async function (browser, iframeDocAcc, contentDocAcc) { + async function (browser, iframeDocAcc) { ok(iframeDocAcc, "IFRAME document accessible is present"); await testBoundsWithContent(iframeDocAcc, "translate", browser); @@ -42,7 +42,7 @@ addAccessibleTask( // test basic rotation addAccessibleTask( `

hello world

`, - async function (browser, iframeDocAcc, contentDocAcc) { + async function (browser, iframeDocAcc) { ok(iframeDocAcc, "IFRAME document accessible is present"); await testBoundsWithContent(iframeDocAcc, "rotate", browser); @@ -60,7 +60,7 @@ addAccessibleTask( // test basic scale addAccessibleTask( `

hello world

`, - async function (browser, iframeDocAcc, contentDocAcc) { + async function (browser, iframeDocAcc) { ok(iframeDocAcc, "IFRAME document accessible is present"); await testBoundsWithContent(iframeDocAcc, "scale", browser); diff --git a/accessible/tests/browser/bounds/browser_test_zoom.js b/accessible/tests/browser/bounds/browser_test_zoom.js index ac84e485a4..1af84d61d8 100644 --- a/accessible/tests/browser/bounds/browser_test_zoom.js +++ b/accessible/tests/browser/bounds/browser_test_zoom.js @@ -16,7 +16,11 @@ async function testContentBounds(browser, acc) { is(x, expectedX, "Wrong x coordinate of " + prettyAccName); is(y, expectedY, "Wrong y coordinate of " + prettyAccName); is(width, expectedWidth, "Wrong width of " + prettyAccName); - ok(height >= expectedHeight, "Wrong height of " + prettyAccName); + Assert.greaterOrEqual( + height, + expectedHeight, + "Wrong height of " + prettyAccName + ); } async function runTests(browser, accDoc) { diff --git a/accessible/tests/browser/bounds/browser_zero_area.js b/accessible/tests/browser/bounds/browser_zero_area.js index c0f9db2673..80954fbd1a 100644 --- a/accessible/tests/browser/bounds/browser_zero_area.js +++ b/accessible/tests/browser/bounds/browser_zero_area.js @@ -67,10 +67,10 @@ addAccessibleTask( const radio = findAccessibleChildByID(accDoc, "radio"); const contentDPR = await getContentDPR(browser); const [x, y, width, height] = getBounds(radio, contentDPR); - ok(x < 0, "X coordinate should be negative"); - ok(y > 0, "Y coordinate should be positive"); - ok(width > 0, "Width should be positive"); - ok(height > 0, "Height should be positive"); + Assert.less(x, 0, "X coordinate should be negative"); + Assert.greater(y, 0, "Y coordinate should be positive"); + Assert.greater(width, 0, "Width should be positive"); + Assert.greater(height, 0, "Height should be positive"); // Note: the exact values of x, y, width, and height // are inconsistent with the DOM element values of those // fields, so we don't check our bounds against them with -- cgit v1.2.3