Skip to content

Commit 5aacc60

Browse files
committed
Create new test type for accessibility API testing
1 parent bd8b39e commit 5aacc60

36 files changed

Lines changed: 1227 additions & 16 deletions

.taskcluster.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ tasks:
5757
owner: ${owner}
5858
source: ${event.repository.clone_url}
5959
payload:
60-
image: ghcr.io/web-platform-tests/wpt:2
60+
image: ghcr.io/web-platform-tests/wpt:3
6161
maxRunTime: 7200
6262
artifacts:
6363
public/results:

lint.ignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ TRAILING WHITESPACE, INDENT TABS, CR AT EOL: *.wbn
5252
TRAILING WHITESPACE, INDENT TABS, CR AT EOL: *.avif
5353
TRAILING WHITESPACE, INDENT TABS, CR AT EOL: *.annexb
5454
TRAILING WHITESPACE, INDENT TABS, CR AT EOL: *.crx
55+
TRAILING WHITESPACE, INDENT TABS, CR AT EOL: *.tlb
5556

5657
## .gitignore
5758
W3C-TEST.ORG: .gitignore

tools/ci/tc/tasks/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ components:
44
workerType: ci
55
schedulerId: taskcluster-github
66
deadline: "24 hours"
7-
image: ghcr.io/web-platform-tests/wpt:2
7+
image: ghcr.io/web-platform-tests/wpt:3
88
maxRunTime: 7200
99
artifacts:
1010
public/results:

tools/docker/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ RUN apt-get -qqy update \
2020
glib-networking-services \
2121
gstreamer1.0-plugins-bad \
2222
gstreamer1.0-gl \
23+
libatspi2.0-dev \
24+
libcairo2-dev \
25+
libgirepository1.0-dev \
2326
libosmesa6-dev \
2427
libproxy1-plugin-webkit \
2528
libvirt-daemon-system \

tools/manifest/item.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,22 @@ def to_json(self) -> Tuple[Optional[Text], Dict[Text, Any]]:
354354
return rv
355355

356356

357+
class AamSpecTest(URLManifestItem):
358+
__slots__ = ()
359+
360+
item_type = "aamspec"
361+
362+
@property
363+
def timeout(self) -> Optional[Text]:
364+
return self._extras.get("timeout")
365+
366+
def to_json(self) -> Tuple[Optional[Text], Dict[Text, Any]]:
367+
rv = super().to_json()
368+
if self.timeout is not None:
369+
rv[-1]["timeout"] = self.timeout
370+
return rv
371+
372+
357373
class SupportFile(ManifestItem):
358374
__slots__ = ()
359375

tools/manifest/manifest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
from . import jsonlib
1010
from . import vcs
11-
from .item import (ConformanceCheckerTest,
11+
from .item import (AamSpecTest,
12+
ConformanceCheckerTest,
1213
CrashTest,
1314
ManifestItem,
1415
ManualTest,
@@ -46,6 +47,7 @@ class InvalidCacheError(Exception):
4647
"crashtest": CrashTest,
4748
"manual": ManualTest,
4849
"wdspec": WebDriverSpecTest,
50+
"aamspec": AamSpecTest,
4951
"conformancechecker": ConformanceCheckerTest,
5052
"visual": VisualTest,
5153
"spec": SpecItem,

tools/manifest/sourcefile.py

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
import html5lib
1717

1818
from . import XMLParser
19-
from .item import (ConformanceCheckerTest,
19+
from .item import (AamSpecTest,
20+
ConformanceCheckerTest,
2021
CrashTest,
2122
ManifestItem,
2223
ManualTest,
@@ -397,6 +398,15 @@ def name_is_webdriver(self) -> bool:
397398
self.filename not in ("__init__.py", "conftest.py") and
398399
fnmatch(self.filename, wd_pattern))
399400

401+
@property
402+
def name_is_wai_aria_aam(self) -> bool:
403+
"""Check if the file name matches the conditions for the file to
404+
be a WAI-ARIA AAM spec test file"""
405+
rel_path_parts = self.rel_path_parts
406+
return ((rel_path_parts[0] == "wai-aria-aam" and len(rel_path_parts) > 1) and
407+
self.filename not in ("__init__.py", "conftest.py") and
408+
fnmatch(self.filename, wd_pattern))
409+
400410
@property
401411
def name_is_reference(self) -> bool:
402412
"""Check if the file name matches the conditions for the file to
@@ -474,7 +484,7 @@ def pac_nodes(self) -> List[ElementTree.Element]:
474484
def script_metadata(self) -> Optional[List[Tuple[Text, Text]]]:
475485
if self.name_is_worker or self.name_is_multi_global or self.name_is_window or self.name_is_extension:
476486
regexp = js_meta_re
477-
elif self.name_is_webdriver:
487+
elif self.name_is_webdriver or self.name_is_wai_aria_aam:
478488
regexp = python_meta_re
479489
else:
480490
return None
@@ -899,6 +909,9 @@ def possible_types(self) -> Set[Text]:
899909
if self.name_is_webdriver:
900910
return {WebDriverSpecTest.item_type}
901911

912+
if self.name_is_wai_aria_aam:
913+
return {AamSpecTest.item_type}
914+
902915
if self.name_is_visual:
903916
return {VisualTest.item_type}
904917

@@ -986,6 +999,16 @@ def manifest_items(self) -> Tuple[Text, List[ManifestItem]]:
986999
timeout=self.timeout
9871000
)]
9881001

1002+
elif self.name_is_wai_aria_aam:
1003+
rv = AamSpecTest.item_type, [
1004+
AamSpecTest(
1005+
self.tests_root,
1006+
self.rel_path,
1007+
self.url_base,
1008+
self.rel_url,
1009+
timeout=self.timeout
1010+
)]
1011+
9891012
elif self.name_is_visual:
9901013
rv = VisualTest.item_type, [
9911014
VisualTest(

tools/mypy.ini

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ follow_imports = silent
4242
follow_imports = silent
4343

4444
# Ignore missing or untyped libraries.
45+
[mypy-ApplicationServices.*]
46+
ignore_missing_imports = True
47+
4548
[mypy-Cocoa.*]
4649
ignore_missing_imports = True
4750

@@ -51,9 +54,15 @@ ignore_missing_imports = True
5154
[mypy-Quartz.*]
5255
ignore_missing_imports = True
5356

57+
[mypy-comtypes.*]
58+
ignore_missing_imports = True
59+
5460
[mypy-dnslib.*]
5561
ignore_missing_imports = True
5662

63+
[mypy-gi.*]
64+
ignore_missing_imports = True
65+
5766
[mypy-marionette_driver.*]
5867
ignore_missing_imports = True
5968

tools/wpt/run.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,9 @@ def setup_kwargs(self, kwargs):
327327
if kwargs["browser_channel"] == "nightly" and kwargs["enable_webtransport_h3"] is None:
328328
kwargs["enable_webtransport_h3"] = True
329329

330+
if kwargs["enable_accessibility_api"]:
331+
kwargs["extra_prefs"].append("accessibility.force_disabled=-1")
332+
330333
# Turn off Firefox WebRTC ICE logging on WPT (turned on by mozrunner)
331334
safe_unsetenv('R_LOG_LEVEL')
332335
safe_unsetenv('R_LOG_DESTINATION')
@@ -517,6 +520,10 @@ def setup_kwargs(self, kwargs):
517520
# We are on Taskcluster, where our Docker container does not have
518521
# enough capabilities to run the browser with sandboxing. (gh-20133)
519522
kwargs["binary_args"].append("--no-sandbox")
523+
if kwargs["enable_accessibility_api"]:
524+
# Necessary to force chrome to register in AT-SPI2.
525+
os.environ["ACCESSIBILITY_ENABLED"] = "1"
526+
kwargs["binary_args"].append("--force-renderer-accessibility")
520527

521528

522529
class Chrome(ChromeAndEdgeSetup):
@@ -902,6 +909,10 @@ def setup_wptrunner(venv, **kwargs):
902909
if not venv.skip_virtualenv_setup:
903910
requirements = [os.path.join(wpt_root, "tools", "wptrunner", "requirements.txt")]
904911
requirements.extend(setup_cls.requirements())
912+
913+
if kwargs["enable_accessibility_api"]:
914+
requirements.append(os.path.join(wpt_root, "tools", "wptrunner", "requirements_platform_accessibility.txt"))
915+
905916
venv.install_requirements(*requirements)
906917

907918
affected_revish = kwargs.get("affected")
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
comtypes==1.4.11; sys_platform == 'win32'
2+
PyGObject==3.50.1; sys_platform == 'linux' and python_version >= '3.9'
3+
PyGObject==3.48.2; sys_platform == 'linux' and python_version < '3.9'
4+
pyobjc-framework-Accessibility==11.1; sys_platform == 'darwin' and python_version >= '3.9'
5+
pyobjc-framework-ApplicationServices==11.1; sys_platform == 'darwin' and python_version >= '3.9'
6+
pyobjc==10.3.2; sys_platform == 'darwin' and python_version < '3.9'
7+
pyobjc-framework-Accessibility==10.3.2; sys_platform == 'darwin' and python_version < '3.9'
8+
pyobjc-framework-ApplicationServices==10.3.2; sys_platform == 'darwin' and python_version < '3.9'

0 commit comments

Comments
 (0)