summaryrefslogtreecommitdiffstats
path: root/accessible/tests/browser/windows/uia/head.js
diff options
context:
space:
mode:
Diffstat (limited to 'accessible/tests/browser/windows/uia/head.js')
-rw-r--r--accessible/tests/browser/windows/uia/head.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/accessible/tests/browser/windows/uia/head.js b/accessible/tests/browser/windows/uia/head.js
index 5b453ce6fe..217b8cb844 100644
--- a/accessible/tests/browser/windows/uia/head.js
+++ b/accessible/tests/browser/windows/uia/head.js
@@ -4,7 +4,7 @@
"use strict";
-/* exported gIsUiaEnabled, addUiaTask, definePyVar, assignPyVarToUiaWithId, setUpWaitForUiaEvent, setUpWaitForUiaPropEvent, waitForUiaEvent, testPatternAbsent, testPythonRaises */
+/* exported gIsUiaEnabled, addUiaTask, definePyVar, assignPyVarToUiaWithId, setUpWaitForUiaEvent, setUpWaitForUiaPropEvent, waitForUiaEvent, testPatternAbsent, testPythonRaises, isUiaElementArray */
// Load the shared-head file first.
Services.scriptloader.loadSubScript(
@@ -126,3 +126,15 @@ async function testPythonRaises(expression, message) {
}
ok(failed, message);
}
+
+/**
+ * Verify that an array of UIA elements contains (only) elements with the given
+ * DOM ids.
+ */
+async function isUiaElementArray(pyExpr, ids, message) {
+ const result = await runPython(`
+ uias = (${pyExpr})
+ return [uias.GetElement(i).CurrentAutomationId for i in range(uias.Length)]
+ `);
+ SimpleTest.isDeeply(result, ids, message);
+}