|
16 | 16 | import html5lib |
17 | 17 |
|
18 | 18 | from . import XMLParser |
19 | | -from .item import (ConformanceCheckerTest, |
| 19 | +from .item import (AamSpecTest, |
| 20 | + ConformanceCheckerTest, |
20 | 21 | CrashTest, |
21 | 22 | ManifestItem, |
22 | 23 | ManualTest, |
@@ -397,6 +398,15 @@ def name_is_webdriver(self) -> bool: |
397 | 398 | self.filename not in ("__init__.py", "conftest.py") and |
398 | 399 | fnmatch(self.filename, wd_pattern)) |
399 | 400 |
|
| 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 | + |
400 | 410 | @property |
401 | 411 | def name_is_reference(self) -> bool: |
402 | 412 | """Check if the file name matches the conditions for the file to |
@@ -474,7 +484,7 @@ def pac_nodes(self) -> List[ElementTree.Element]: |
474 | 484 | def script_metadata(self) -> Optional[List[Tuple[Text, Text]]]: |
475 | 485 | if self.name_is_worker or self.name_is_multi_global or self.name_is_window or self.name_is_extension: |
476 | 486 | regexp = js_meta_re |
477 | | - elif self.name_is_webdriver: |
| 487 | + elif self.name_is_webdriver or self.name_is_wai_aria_aam: |
478 | 488 | regexp = python_meta_re |
479 | 489 | else: |
480 | 490 | return None |
@@ -899,6 +909,9 @@ def possible_types(self) -> Set[Text]: |
899 | 909 | if self.name_is_webdriver: |
900 | 910 | return {WebDriverSpecTest.item_type} |
901 | 911 |
|
| 912 | + if self.name_is_wai_aria_aam: |
| 913 | + return {AamSpecTest.item_type} |
| 914 | + |
902 | 915 | if self.name_is_visual: |
903 | 916 | return {VisualTest.item_type} |
904 | 917 |
|
@@ -986,6 +999,16 @@ def manifest_items(self) -> Tuple[Text, List[ManifestItem]]: |
986 | 999 | timeout=self.timeout |
987 | 1000 | )] |
988 | 1001 |
|
| 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 | + |
989 | 1012 | elif self.name_is_visual: |
990 | 1013 | rv = VisualTest.item_type, [ |
991 | 1014 | VisualTest( |
|
0 commit comments