From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../browser/e10s/browser_caching_relations.js | 291 +++++++++++++++++++++ 1 file changed, 291 insertions(+) create mode 100644 accessible/tests/browser/e10s/browser_caching_relations.js (limited to 'accessible/tests/browser/e10s/browser_caching_relations.js') diff --git a/accessible/tests/browser/e10s/browser_caching_relations.js b/accessible/tests/browser/e10s/browser_caching_relations.js new file mode 100644 index 0000000000..cc83930830 --- /dev/null +++ b/accessible/tests/browser/e10s/browser_caching_relations.js @@ -0,0 +1,291 @@ +/* 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); + +/** + * A test specification that has the following format: + * [ + * attr relevant aria attribute + * hostRelation corresponding host relation type + * dependantRelation corresponding dependant relation type + * ] + */ +const attrRelationsSpec = [ + ["aria-labelledby", RELATION_LABELLED_BY, RELATION_LABEL_FOR], + ["aria-describedby", RELATION_DESCRIBED_BY, RELATION_DESCRIPTION_FOR], + ["aria-controls", RELATION_CONTROLLER_FOR, RELATION_CONTROLLED_BY], + ["aria-flowto", RELATION_FLOWS_TO, RELATION_FLOWS_FROM], + ["aria-details", RELATION_DETAILS, RELATION_DETAILS_FOR], + ["aria-errormessage", RELATION_ERRORMSG, RELATION_ERRORMSG_FOR], +]; + +/** + * Test caching of relations between accessible objects. + */ +addAccessibleTask( + ` +
label
+
label2
+ `, + async function (browser, accDoc) { + for (let spec of attrRelationsSpec) { + await testRelated(browser, accDoc, ...spec); + } + }, + { iframe: true, remoteIframe: true } +); + +/** + * Test caching of relations with respect to label objects and their "for" attr. + */ +addAccessibleTask( + ` + + + `, + async function (browser, accDoc) { + await testRelated( + browser, + accDoc, + "for", + RELATION_LABEL_FOR, + RELATION_LABELLED_BY + ); + }, + { iframe: true, remoteIframe: true } +); + +/** + * Test rel caching for element with existing relation attribute. + */ +addAccessibleTask( + `
label