Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Commit

Permalink
Mark manual CSS WG-style tests as being manual tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gsnedders committed Aug 19, 2016
1 parent f73797f commit d44082c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions manifest/sourcefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,32 @@ def content_is_ref_node(self):
graph (i.e. if it contains any <link rel=[mis]match>"""
return bool(self.references)

@cached_property
def css_flag_nodes(self):
"""List of ElementTree Elements corresponding to nodes representing a
to a flag <meta>"""
if not self.root:
return []
return self.root.findall(".//{http://www.w3.org/1999/xhtml}meta[@name='flags']")

@cached_property
def css_flags(self):
"""Set of flags specified in the file"""
rv = set()
for item in self.css_flag_nodes:
if "content" in item.attrib:
for flag in item.attrib["content"].split():
rv.add(flag)
return rv

@cached_property
def content_is_css_manual(self):
"""Boolean indicating whether the file content represents a
CSS WG-style manual test"""
if not self.root:
return None
return bool(self.css_flags & {"animated", "font", "interact", "paged", "speech", "userstyle"})

def manifest_items(self):
"""List of manifest items corresponding to the file. There is typically one
per test, but in the case of reftests a node may have corresponding manifest
Expand All @@ -340,6 +366,9 @@ def manifest_items(self):
elif self.name_is_webdriver:
rv = [WebdriverSpecTest(self, self.url)]

elif self.content_is_css_manual:
rv = [ManualTest(self, self.url)]

elif self.content_is_testharness:
rv = []
for variant in self.test_variants:
Expand Down

0 comments on commit d44082c

Please sign in to comment.