From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../browser/e10s/browser_caching_relations_002.js | 293 +++++++++++++++++++++ 1 file changed, 293 insertions(+) create mode 100644 accessible/tests/browser/e10s/browser_caching_relations_002.js (limited to 'accessible/tests/browser/e10s/browser_caching_relations_002.js') diff --git a/accessible/tests/browser/e10s/browser_caching_relations_002.js b/accessible/tests/browser/e10s/browser_caching_relations_002.js new file mode 100644 index 0000000000..9b7acda96a --- /dev/null +++ b/accessible/tests/browser/e10s/browser_caching_relations_002.js @@ -0,0 +1,293 @@ +/* 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"; +requestLongerTimeout(2); + +/** + * Test MEMBER_OF relation caching on HTML radio buttons + */ +addAccessibleTask( + ` + I have no name
+ I also have no name
+ I have a name
+ I have a different name
+
+ I have an already used name + and am in a different part of the tree + I have a different name but am + in the same group +
`, + async function (browser, accDoc) { + const r1 = findAccessibleChildByID(accDoc, "r1"); + const r2 = findAccessibleChildByID(accDoc, "r2"); + const r3 = findAccessibleChildByID(accDoc, "r3"); + const r4 = findAccessibleChildByID(accDoc, "r4"); + const r5 = findAccessibleChildByID(accDoc, "r5"); + const r6 = findAccessibleChildByID(accDoc, "r6"); + + await testCachedRelation(r1, RELATION_MEMBER_OF, null); + await testCachedRelation(r2, RELATION_MEMBER_OF, null); + await testCachedRelation(r3, RELATION_MEMBER_OF, [r3, r5]); + await testCachedRelation(r4, RELATION_MEMBER_OF, r4); + await testCachedRelation(r5, RELATION_MEMBER_OF, [r3, r5]); + await testCachedRelation(r6, RELATION_MEMBER_OF, r6); + + await invokeContentTask(browser, [], () => { + content.document.getElementById("r5").name = "a"; + }); + + await testCachedRelation(r3, RELATION_MEMBER_OF, r3); + await testCachedRelation(r4, RELATION_MEMBER_OF, [r5, r4]); + await testCachedRelation(r5, RELATION_MEMBER_OF, [r5, r4]); + }, + { chrome: true, iframe: true, remoteIframe: true } +); + +/* + * Test MEMBER_OF relation caching on aria radio buttons + */ +addAccessibleTask( + ` +
+
+
+
+
`, + async function (browser, accDoc) { + const r1 = findAccessibleChildByID(accDoc, "r1"); + const r2 = findAccessibleChildByID(accDoc, "r2"); + let r3 = findAccessibleChildByID(accDoc, "r3"); + + await testCachedRelation(r1, RELATION_MEMBER_OF, null); + await testCachedRelation(r2, RELATION_MEMBER_OF, [r2, r3]); + await testCachedRelation(r3, RELATION_MEMBER_OF, [r2, r3]); + const r = waitForEvent(EVENT_INNER_REORDER, "fs"); + await invokeContentTask(browser, [], () => { + let innerRadio = content.document.getElementById("r3"); + content.document.body.appendChild(innerRadio); + }); + await r; + + r3 = findAccessibleChildByID(accDoc, "r3"); + await testCachedRelation(r1, RELATION_MEMBER_OF, null); + await testCachedRelation(r2, RELATION_MEMBER_OF, r2); + await testCachedRelation(r3, RELATION_MEMBER_OF, null); + }, + { + chrome: true, + iframe: true, + remoteIframe: true, + } +); + +/* + * Test mutation of LABEL relations via accessible shutdown. + */ +addAccessibleTask( + ` +
+