diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /accessible/tests/browser/windows/ia2 | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.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/windows/ia2')
-rw-r--r-- | accessible/tests/browser/windows/ia2/browser.toml | 9 | ||||
-rw-r--r-- | accessible/tests/browser/windows/ia2/browser_role.js | 39 | ||||
-rw-r--r-- | accessible/tests/browser/windows/ia2/head.js | 18 |
3 files changed, 66 insertions, 0 deletions
diff --git a/accessible/tests/browser/windows/ia2/browser.toml b/accessible/tests/browser/windows/ia2/browser.toml new file mode 100644 index 0000000000..d72b5f8a2d --- /dev/null +++ b/accessible/tests/browser/windows/ia2/browser.toml @@ -0,0 +1,9 @@ +[DEFAULT] +subsuite = "a11y" +skip-if = [ + "os != 'win'", + "headless", +] +support-files = ["head.js"] + +["browser_role.js"] diff --git a/accessible/tests/browser/windows/ia2/browser_role.js b/accessible/tests/browser/windows/ia2/browser_role.js new file mode 100644 index 0000000000..08e44c280f --- /dev/null +++ b/accessible/tests/browser/windows/ia2/browser_role.js @@ -0,0 +1,39 @@ +/* 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"; + +const ROLE_SYSTEM_DOCUMENT = 15; +const ROLE_SYSTEM_GROUPING = 20; +const IA2_ROLE_PARAGRAPH = 1054; + +addAccessibleTask( + ` +<p id="p">p</p> + `, + async function (browser, docAcc) { + let role = await runPython(` + global doc + doc = getDocIa2() + return doc.accRole(CHILDID_SELF) + `); + is(role, ROLE_SYSTEM_DOCUMENT, "doc has correct MSAA role"); + role = await runPython(`doc.role()`); + is(role, ROLE_SYSTEM_DOCUMENT, "doc has correct IA2 role"); + ok( + await runPython(` + global p + p = findIa2ByDomId(doc, "p") + firstChild = toIa2(doc.accChild(1)) + return p == firstChild + `), + "doc's first child is p" + ); + role = await runPython(`p.accRole(CHILDID_SELF)`); + is(role, ROLE_SYSTEM_GROUPING, "p has correct MSAA role"); + role = await runPython(`p.role()`); + is(role, IA2_ROLE_PARAGRAPH, "p has correct IA2 role"); + }, + { chrome: true, topLevel: true, iframe: true, remoteIframe: true } +); diff --git a/accessible/tests/browser/windows/ia2/head.js b/accessible/tests/browser/windows/ia2/head.js new file mode 100644 index 0000000000..afc50984bd --- /dev/null +++ b/accessible/tests/browser/windows/ia2/head.js @@ -0,0 +1,18 @@ +/* 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"; + +// Load the shared-head file first. +Services.scriptloader.loadSubScript( + "chrome://mochitests/content/browser/accessible/tests/browser/shared-head.js", + this +); + +// Loading and common.js from accessible/tests/mochitest/ for all tests, as +// well as promisified-events.js. +loadScripts( + { name: "common.js", dir: MOCHITESTS_DIR }, + { name: "promisified-events.js", dir: MOCHITESTS_DIR } +); |