mirror of
https://github.com/servo/servo.git
synced 2025-09-11 15:38:24 +01:00
Update web-platform-tests to revision 81962ac8802223d038b188b6f9cb88a0a9c5beee
This commit is contained in:
parent
fe1a057bd1
commit
24183668c4
1960 changed files with 29853 additions and 10555 deletions
|
@ -102,10 +102,11 @@ class URLManifestItem(ManifestItem):
|
|||
class TestharnessTest(URLManifestItem):
|
||||
item_type = "testharness"
|
||||
|
||||
def __init__(self, source_file, url, url_base="/", timeout=None, testdriver=False, manifest=None):
|
||||
def __init__(self, source_file, url, url_base="/", timeout=None, testdriver=False, jsshell=False, manifest=None):
|
||||
URLManifestItem.__init__(self, source_file, url, url_base=url_base, manifest=manifest)
|
||||
self.timeout = timeout
|
||||
self.testdriver = testdriver
|
||||
self.jsshell = jsshell
|
||||
|
||||
def meta_key(self):
|
||||
return (self.timeout, self.testdriver)
|
||||
|
@ -116,6 +117,8 @@ class TestharnessTest(URLManifestItem):
|
|||
rv[-1]["timeout"] = self.timeout
|
||||
if self.testdriver:
|
||||
rv[-1]["testdriver"] = self.testdriver
|
||||
if self.jsshell:
|
||||
rv[-1]["jsshell"] = True
|
||||
return rv
|
||||
|
||||
@classmethod
|
||||
|
@ -128,6 +131,7 @@ class TestharnessTest(URLManifestItem):
|
|||
url_base=manifest.url_base,
|
||||
timeout=extras.get("timeout"),
|
||||
testdriver=bool(extras.get("testdriver")),
|
||||
jsshell=bool(extras.get("jsshell")),
|
||||
manifest=manifest)
|
||||
|
||||
|
||||
|
|
|
@ -55,7 +55,8 @@ _any_variants = {
|
|||
b"serviceworker": {"force_https": True},
|
||||
b"sharedworker": {},
|
||||
b"dedicatedworker": {"suffix": ".any.worker.html"},
|
||||
b"worker": {"longhand": {b"dedicatedworker", b"sharedworker", b"serviceworker"}}
|
||||
b"worker": {"longhand": {b"dedicatedworker", b"sharedworker", b"serviceworker"}},
|
||||
b"jsshell": {"suffix": ".any.js"},
|
||||
}
|
||||
|
||||
|
||||
|
@ -100,8 +101,9 @@ def parse_variants(value):
|
|||
|
||||
def global_suffixes(value):
|
||||
"""
|
||||
Yields the relevant filename suffixes (strings) for the variants defined by
|
||||
the given comma-separated value.
|
||||
Yields tuples of the relevant filename suffix (a string) and whether the
|
||||
variant is intended to run in a JS shell, for the variants defined by the
|
||||
given comma-separated value.
|
||||
"""
|
||||
assert isinstance(value, binary_type), value
|
||||
|
||||
|
@ -113,7 +115,7 @@ def global_suffixes(value):
|
|||
suffix = variant.get("suffix", ".any.%s.html" % global_type.decode("utf-8"))
|
||||
if variant.get("force_https", False):
|
||||
suffix = ".https" + suffix
|
||||
rv.add(suffix)
|
||||
rv.add((suffix, global_type == b"jsshell"))
|
||||
|
||||
return rv
|
||||
|
||||
|
@ -560,7 +562,7 @@ class SourceFile(object):
|
|||
@cached_property
|
||||
def content_is_css_visual(self):
|
||||
"""Boolean indicating whether the file content represents a
|
||||
CSS WG-style manual test"""
|
||||
CSS WG-style visual test"""
|
||||
if self.root is None:
|
||||
return None
|
||||
return bool(self.ext in {'.xht', '.html', '.xhtml', '.htm', '.xml', '.svg'} and
|
||||
|
@ -605,8 +607,8 @@ class SourceFile(object):
|
|||
break
|
||||
|
||||
tests = [
|
||||
TestharnessTest(self, global_variant_url(self.url, suffix) + variant, timeout=self.timeout)
|
||||
for suffix in sorted(global_suffixes(globals))
|
||||
TestharnessTest(self, global_variant_url(self.url, suffix) + variant, timeout=self.timeout, jsshell=jsshell)
|
||||
for (suffix, jsshell) in sorted(global_suffixes(globals))
|
||||
for variant in self.test_variants
|
||||
]
|
||||
rv = TestharnessTest.item_type, tests
|
||||
|
|
|
@ -376,6 +376,37 @@ test()""" % input
|
|||
|
||||
for item, url in zip(items, expected_urls):
|
||||
assert item.url == url
|
||||
assert item.jsshell is False
|
||||
assert item.timeout is None
|
||||
|
||||
|
||||
def test_multi_global_with_jsshell_globals():
|
||||
contents = b"""// META: global=jsshell
|
||||
test()"""
|
||||
|
||||
s = create("html/test.any.js", contents=contents)
|
||||
assert not s.name_is_non_test
|
||||
assert not s.name_is_manual
|
||||
assert not s.name_is_visual
|
||||
assert s.name_is_multi_global
|
||||
assert not s.name_is_worker
|
||||
assert not s.name_is_reference
|
||||
|
||||
assert not s.content_is_testharness
|
||||
|
||||
item_type, items = s.manifest_items()
|
||||
assert item_type == "testharness"
|
||||
|
||||
expected = [
|
||||
("/html/test.any.html", False),
|
||||
("/html/test.any.js", True),
|
||||
("/html/test.any.worker.html", False),
|
||||
]
|
||||
assert len(items) == len(expected)
|
||||
|
||||
for item, (url, jsshell) in zip(items, expected):
|
||||
assert item.url == url
|
||||
assert item.jsshell == jsshell
|
||||
assert item.timeout is None
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue