summaryrefslogtreecommitdiffstats
path: root/accessible/tests/browser/atk/browser_table.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /accessible/tests/browser/atk/browser_table.js
parentInitial commit. (diff)
downloadfirefox-upstream/124.0.1.tar.xz
firefox-upstream/124.0.1.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'accessible/tests/browser/atk/browser_table.js')
-rw-r--r--accessible/tests/browser/atk/browser_table.js54
1 files changed, 54 insertions, 0 deletions
diff --git a/accessible/tests/browser/atk/browser_table.js b/accessible/tests/browser/atk/browser_table.js
new file mode 100644
index 0000000000..98b3270465
--- /dev/null
+++ b/accessible/tests/browser/atk/browser_table.js
@@ -0,0 +1,54 @@
+/* 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 getRowColumnSpan.
+ */
+addAccessibleTask(
+ `
+<table>
+ <tr>
+ <th id="ab" colspan="2">ab</th>
+ <td id="cf" rowspan="2">cf</td>
+ </tr>
+ <tr>
+ <td id="d">d</td>
+ <td>e</td>
+ </tr>
+</table>
+ `,
+ async function (browser, docAcc) {
+ let result = await runPython(`
+ global doc
+ doc = getDoc()
+ ab = findByDomId(doc, "ab")
+ return str(ab.queryTableCell().getRowColumnSpan())
+ `);
+ is(
+ result,
+ "(row=0, column=0, row_span=1, column_span=2)",
+ "ab getColumnRowSpan correct"
+ );
+ result = await runPython(`
+ cf = findByDomId(doc, "cf")
+ return str(cf.queryTableCell().getRowColumnSpan())
+ `);
+ is(
+ result,
+ "(row=0, column=2, row_span=2, column_span=1)",
+ "cf getColumnRowSpan correct"
+ );
+ result = await runPython(`
+ d = findByDomId(doc, "d")
+ return str(d.queryTableCell().getRowColumnSpan())
+ `);
+ is(
+ result,
+ "(row=1, column=0, row_span=1, column_span=1)",
+ "d getColumnRowSpan correct"
+ );
+ }
+);