Update web-platform-tests to revision 85e8612e81c8b478c8cac7260436646e48d3f7ae

This commit is contained in:
WPT Sync Bot 2019-04-16 21:36:56 -04:00
parent a14b952fa3
commit 87dcce0f06
66 changed files with 697 additions and 266 deletions

View file

@ -135,7 +135,7 @@ class MarionetteTestharnessProtocolPart(TestharnessProtocolPart):
"Loading initial page %s failed. Ensure that the "
"there are no other programs bound to this port and "
"that your firewall rules or network setup does not "
"prevent access.\e%s" % (url, traceback.format_exc(e)))
r"prevent access.\e%s" % (url, traceback.format_exc(e)))
raise
self.runner_handle = self.marionette.current_window_handle
format_map = {"title": threading.current_thread().name.replace("'", '"')}
@ -212,7 +212,7 @@ class MarionetteTestharnessProtocolPart(TestharnessProtocolPart):
if test_window is None:
handles = self.marionette.window_handles
if len(handles) == 2:
test_window = next(iter(set(handles) - set([parent])))
test_window = next(iter(set(handles) - {parent}))
elif handles[0] == parent and len(handles) > 2:
# Hope the first one here is the test window
test_window = handles[1]

View file

@ -128,7 +128,7 @@ class SeleniumTestharnessProtocolPart(TestharnessProtocolPart):
if test_window is None:
after = self.webdriver.window_handles
if len(after) == 2:
test_window = next(iter(set(after) - set([parent])))
test_window = next(iter(set(after) - {parent}))
elif after[0] == parent and len(after) > 2:
# Hope the first one here is the test window
test_window = after[1]
@ -247,7 +247,7 @@ class SeleniumRun(object):
timeout = self.timeout
try:
self.protocol.base.set_timeout((timeout + extra_timeout))
self.protocol.base.set_timeout(timeout + extra_timeout)
except exceptions.ErrorInResponseException:
self.logger.error("Lost WebDriver connection")
return Stop

View file

@ -121,7 +121,7 @@ class WebDriverTestharnessProtocolPart(TestharnessProtocolPart):
if test_window is None:
after = self.webdriver.handles
if len(after) == 2:
test_window = next(iter(set(after) - set([parent])))
test_window = next(iter(set(after) - {parent}))
elif after[0] == parent and len(after) > 2:
# Hope the first one here is the test window
test_window = after[1]
@ -258,7 +258,7 @@ class WebDriverRun(object):
timeout = self.timeout
try:
self.protocol.base.set_timeout((timeout + extra_timeout))
self.protocol.base.set_timeout(timeout + extra_timeout)
except client.UnknownErrorException:
self.logger.error("Lost WebDriver connection")
return Stop

View file

@ -353,7 +353,7 @@ class TestNode(ManifestItem):
@property
def is_empty(self):
required_keys = set(["type"])
required_keys = {"type"}
if set(self._data.keys()) != required_keys:
return False
return all(child.is_empty for child in self.children)

View file

@ -182,7 +182,7 @@ class TestNode(ManifestItem):
@property
def is_empty(self):
ignore_keys = set(["type"])
ignore_keys = {"type"}
if set(self._data.keys()) - ignore_keys:
return False
return all(child.is_empty for child in self.children)
@ -663,7 +663,7 @@ def group_conditionals(values, property_order=None, boolean_properties=None):
property_order = ["debug", "os", "version", "processor", "bits"]
if boolean_properties is None:
boolean_properties = set(["debug"])
boolean_properties = {"debug"}
else:
boolean_properties = set(boolean_properties)
@ -676,7 +676,7 @@ def group_conditionals(values, property_order=None, boolean_properties=None):
if not by_property:
raise ConditionError
properties = set(item[0] for item in by_property.iterkeys())
properties = {item[0] for item in by_property.iterkeys()}
include_props = []
for prop in property_order:

View file

@ -516,7 +516,7 @@ class PackedResultList(object):
else:
value = status_intern.get(value_idx)
run_info = run_info_intern.get((packed & 0x00FF))
run_info = run_info_intern.get(packed & 0x00FF)
return prop, run_info, value

View file

@ -110,14 +110,13 @@ class TagFilter(object):
class ManifestLoader(object):
def __init__(self, test_paths, force_manifest_update=False, manifest_download=False,
types=None, meta_filters=None):
types=None):
do_delayed_imports()
self.test_paths = test_paths
self.force_manifest_update = force_manifest_update
self.manifest_download = manifest_download
self.types = types
self.logger = structured.get_default_logger()
self.meta_filters = meta_filters
if self.logger is None:
self.logger = structured.structuredlog.StructuredLogger("ManifestLoader")
@ -137,7 +136,7 @@ class ManifestLoader(object):
download_from_github(manifest_path, tests_path)
return manifest.load_and_update(tests_path, manifest_path, url_base,
cache_root=cache_root, update=self.force_manifest_update,
meta_filters=self.meta_filters, types=self.types)
types=self.types)
def iterfilter(filters, iter):

View file

@ -62,7 +62,7 @@ def make_mock_manifest(*items):
filename = dir_path + "/%i.html" % i
tests.append((test_type,
filename,
set([TestharnessTest("/foo.bar", filename, "/", filename)])))
{TestharnessTest("/foo.bar", filename, "/", filename)}))
return rv

View file

@ -478,7 +478,7 @@ class Tokenizer(object):
elif c == "U":
return self.decode_escape(6)
elif c in ["a", "b", "f", "n", "r", "t", "v"]:
return eval("'\%s'" % c)
return eval(r"'\%s'" % c)
elif c is eol:
raise ParseError(self.filename, self.line_number, "EOL in escape")
else:

View file

@ -3,7 +3,7 @@ from .parser import atoms, precedence
atom_names = {v:"@%s" % k for (k,v) in atoms.items()}
named_escapes = set(["\a", "\b", "\f", "\n", "\r", "\t", "\v"])
named_escapes = {"\a", "\b", "\f", "\n", "\r", "\t", "\v"}
def escape(string, extras=""):
# Assumes input bytes are either UTF8 bytes or unicode.

View file

@ -142,4 +142,4 @@ key_1: other_value
self.assertTrue(manifest.has_key("key_1"))
self.assertFalse(manifest.has_key("key_2"))
self.assertEquals(set(manifest.iterkeys()), set(["key", "key_1"]))
self.assertEquals(set(manifest.iterkeys()), {"key", "key_1"})

View file

@ -146,7 +146,7 @@ class TokenizerTest(unittest.TestCase):
""")
def test_18(self):
self.compare("""key: \]
self.compare(r"""key: \]
""", """key: ]
""")

View file

@ -87,8 +87,8 @@ key_1: other_value
self.assertTrue(manifest.has_key("key_1"))
self.assertFalse(manifest.has_key("key_2"))
self.assertEquals(set(manifest.iterkeys()), set(["key", "key_1"]))
self.assertEquals(set(manifest.itervalues()), set(["value_1", "other_value"]))
self.assertEquals(set(manifest.iterkeys()), {"key", "key_1"})
self.assertEquals(set(manifest.itervalues()), {"value_1", "other_value"})
def test_is_empty_1(self):
data = """

View file

@ -27,7 +27,7 @@ class TokenizerTest(unittest.TestCase):
(token_types.paren, "]")])
def test_heading_1(self):
self.compare(b"""[Heading [text\]]""",
self.compare(br"""[Heading [text\]]""",
[(token_types.paren, "["),
(token_types.string, "Heading [text]"),
(token_types.paren, "]")])
@ -39,7 +39,7 @@ class TokenizerTest(unittest.TestCase):
(token_types.paren, "]")])
def test_heading_3(self):
self.compare(b"""[Heading [\]text]""",
self.compare(br"""[Heading [\]text]""",
[(token_types.paren, "["),
(token_types.string, "Heading []text"),
(token_types.paren, "]")])
@ -49,7 +49,7 @@ class TokenizerTest(unittest.TestCase):
self.tokenize(b"[Heading")
def test_heading_5(self):
self.compare(b"""[Heading [\]text] #comment""",
self.compare(br"""[Heading [\]text] #comment""",
[(token_types.paren, "["),
(token_types.string, "Heading []text"),
(token_types.paren, "]")])

View file

@ -6,7 +6,7 @@ from collections import defaultdict
from .wptmanifest.parser import atoms
atom_reset = atoms["Reset"]
enabled_tests = set(["testharness", "reftest", "wdspec"])
enabled_tests = {"testharness", "reftest", "wdspec"}
class Result(object):
@ -39,28 +39,28 @@ class SubtestResult(object):
class TestharnessResult(Result):
default_expected = "OK"
statuses = set(["OK", "ERROR", "INTERNAL-ERROR", "TIMEOUT", "EXTERNAL-TIMEOUT", "CRASH"])
statuses = {"OK", "ERROR", "INTERNAL-ERROR", "TIMEOUT", "EXTERNAL-TIMEOUT", "CRASH"}
class TestharnessSubtestResult(SubtestResult):
default_expected = "PASS"
statuses = set(["PASS", "FAIL", "TIMEOUT", "NOTRUN"])
statuses = {"PASS", "FAIL", "TIMEOUT", "NOTRUN"}
class ReftestResult(Result):
default_expected = "PASS"
statuses = set(["PASS", "FAIL", "ERROR", "INTERNAL-ERROR", "TIMEOUT", "EXTERNAL-TIMEOUT",
"CRASH"])
statuses = {"PASS", "FAIL", "ERROR", "INTERNAL-ERROR", "TIMEOUT", "EXTERNAL-TIMEOUT",
"CRASH"}
class WdspecResult(Result):
default_expected = "OK"
statuses = set(["OK", "ERROR", "INTERNAL-ERROR", "TIMEOUT", "EXTERNAL-TIMEOUT", "CRASH"])
statuses = {"OK", "ERROR", "INTERNAL-ERROR", "TIMEOUT", "EXTERNAL-TIMEOUT", "CRASH"}
class WdspecSubtestResult(SubtestResult):
default_expected = "PASS"
statuses = set(["PASS", "FAIL", "ERROR"])
statuses = {"PASS", "FAIL", "ERROR"}
def get_run_info(metadata_root, product, **kwargs):