Update web-platform-tests to revision 9817f7f027fe1e92cc2fce31d6002c4d669918e8

This commit is contained in:
WPT Sync Bot 2018-03-08 20:11:36 -05:00 committed by Josh Matthews
parent 8e52f8a523
commit f3533538ea
2144 changed files with 21364 additions and 11001 deletions

View file

@ -32,6 +32,8 @@
#
# * Test the tests, add new ones to Git, remove deleted ones from Git, etc.
from __future__ import print_function
import re
import codecs
import time
@ -191,7 +193,7 @@ def genTestUtils(TESTOUTPUTDIR, IMAGEOUTPUTDIR, TEMPLATEFILE, NAME2DIRFILE, ISOF
mapped_name = "%s/%s" % (name_mapping[mn], name)
break
if not mapped_name:
print "LIKELY ERROR: %s has no defined target directory mapping" % name
print("LIKELY ERROR: %s has no defined target directory mapping" % name)
if 'manual' in test:
mapped_name += "-manual"
return mapped_name
@ -269,10 +271,10 @@ def genTestUtils(TESTOUTPUTDIR, IMAGEOUTPUTDIR, TEMPLATEFILE, NAME2DIRFILE, ISOF
test = tests[i]
name = test['name']
print "\r(%s)" % name, " "*32, "\t",
print("\r(%s)" % name, " "*32, "\t")
if name in used_tests:
print "Test %s is defined twice" % name
print("Test %s is defined twice" % name)
used_tests[name] = 1
mapped_name = map_name(name)
@ -292,14 +294,14 @@ def genTestUtils(TESTOUTPUTDIR, IMAGEOUTPUTDIR, TEMPLATEFILE, NAME2DIRFILE, ISOF
for ref in test.get('testing', []):
if ref not in spec_ids:
print "Test %s uses nonexistent spec point %s" % (name, ref)
print("Test %s uses nonexistent spec point %s" % (name, ref))
spec_refs.setdefault(ref, []).append(name)
if not test.get('testing', []):
print "Test %s doesn't refer to any spec points" % name
print("Test %s doesn't refer to any spec points" % name)
if test.get('expected', '') == 'green' and re.search(r'@assert pixel .* 0,0,0,0;', test['code']):
print "Probable incorrect pixel test in %s" % name
print("Probable incorrect pixel test in %s" % name)
code = expand_test_code(test['code'])
@ -312,7 +314,8 @@ def genTestUtils(TESTOUTPUTDIR, IMAGEOUTPUTDIR, TEMPLATEFILE, NAME2DIRFILE, ISOF
elif expected == 'clear':
expected_img = "/images/" + make_flat_image('clear-100x50.png', 100, 50, 0,0,0,0)
else:
if ';' in expected: print "Found semicolon in %s" % name
if ';' in expected:
print("Found semicolon in %s" % name)
expected = re.sub(r'^size (\d+) (\d+)',
r'surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, \1, \2)\ncr = cairo.Context(surface)',
expected)
@ -394,7 +397,7 @@ def genTestUtils(TESTOUTPUTDIR, IMAGEOUTPUTDIR, TEMPLATEFILE, NAME2DIRFILE, ISOF
f = codecs.open('%s/%s%s.worker.js' % (TESTOUTPUTDIR, mapped_name, name_variant), 'w', 'utf-8')
f.write(templates['w3cworker'] % template_params)
print
print()
def getNodeText(node):
@ -469,7 +472,7 @@ def genTestUtils(TESTOUTPUTDIR, IMAGEOUTPUTDIR, TEMPLATEFILE, NAME2DIRFILE, ISOF
for a in spec_assertions:
# Warn about problems
if a['id'] not in spec_refs:
print "Unused spec statement %s" % a['id']
print("Unused spec statement %s" % a['id'])
pattern_text = a['text']
@ -529,11 +532,11 @@ def genTestUtils(TESTOUTPUTDIR, IMAGEOUTPUTDIR, TEMPLATEFILE, NAME2DIRFILE, ISOF
continue # discard this match
if id in matched_assertions:
print "Spec statement %s matches multiple places" % id
print("Spec statement %s matches multiple places" % id)
matched_assertions[id] = True
if m.lastindex != 1:
print "Spec statement %s has incorrect number of match groups" % id
print("Spec statement %s has incorrect number of match groups" % id)
end = m.end(1)
end_node = None
@ -574,7 +577,7 @@ def genTestUtils(TESTOUTPUTDIR, IMAGEOUTPUTDIR, TEMPLATEFILE, NAME2DIRFILE, ISOF
for s in spec_assertions:
if s['id'] not in matched_assertions:
print "Annotation incomplete: Unmatched spec statement %s" % s['id']
print("Annotation incomplete: Unmatched spec statement %s" % s['id'])
# Convert from XHTML back to HTML
doc.documentElement.removeAttribute('xmlns')