mirror of
https://github.com/servo/servo.git
synced 2025-08-14 18:05:36 +01:00
Update web-platform-tests to revision 2b758296541cf4f2209b8c2352cf6c7890c97be3
This commit is contained in:
parent
2304f02123
commit
835d593cd0
118 changed files with 3269 additions and 703 deletions
|
@ -1,3 +1,4 @@
|
|||
suggested_reviewers:
|
||||
- jgraham
|
||||
- gsnedders
|
||||
- jugglinmike
|
||||
|
|
|
@ -110,7 +110,7 @@ def call(*args):
|
|||
|
||||
Returns a bytestring of the subprocess output if no error.
|
||||
"""
|
||||
logger.debug("%s" % " ".join(args))
|
||||
logger.debug(" ".join(args))
|
||||
try:
|
||||
return subprocess.check_output(args)
|
||||
except subprocess.CalledProcessError as e:
|
||||
|
|
|
@ -58,7 +58,7 @@ def tag(repo, owner, sha, tag):
|
|||
url = "https://api.github.com/repos/%s/%s/git/refs" % (repo, owner)
|
||||
req = urllib2.Request(url, data=data)
|
||||
|
||||
base64string = base64.b64encode('%s' % (os.environ["GH_TOKEN"]))
|
||||
base64string = base64.b64encode(os.environ["GH_TOKEN"])
|
||||
req.add_header("Authorization", "Basic %s" % base64string)
|
||||
|
||||
opener = urllib2.build_opener(urllib2.HTTPSHandler())
|
||||
|
|
|
@ -265,6 +265,9 @@ class Chrome(BrowserSetup):
|
|||
logger.info("Automatically turning on experimental features for Chrome Dev")
|
||||
kwargs["binary_args"].append("--enable-experimental-web-platform-features")
|
||||
|
||||
# Allow audio autoplay without a user gesture.
|
||||
kwargs["binary_args"].append("--autoplay-policy=no-user-gesture-required")
|
||||
|
||||
# Allow WebRTC tests to call getUserMedia.
|
||||
kwargs["binary_args"] += ["--use-fake-ui-for-media-stream", "--use-fake-device-for-media-stream"]
|
||||
|
||||
|
|
|
@ -219,6 +219,11 @@ def affected_testfiles(files_changed, skip_tests, manifest_path=None):
|
|||
test_files = {os.path.join(wpt_root, path)
|
||||
for _, path, _ in wpt_manifest.itertypes(*test_types)}
|
||||
|
||||
interface_dir = os.path.join(wpt_root, 'interfaces')
|
||||
interfaces_files = {os.path.join(wpt_root, 'interfaces', filename)
|
||||
for filename in os.listdir(interface_dir)}
|
||||
|
||||
interfaces_changed = interfaces_files.intersection(nontests_changed)
|
||||
nontests_changed = nontests_changed.intersection(support_files)
|
||||
|
||||
tests_changed = set(item for item in files_changed if item in test_files)
|
||||
|
@ -237,6 +242,9 @@ def affected_testfiles(files_changed, skip_tests, manifest_path=None):
|
|||
full_path = os.path.join(wpt_root, repo_path[1:].replace("/", os.path.sep))
|
||||
nontest_changed_paths.add((full_path, repo_path))
|
||||
|
||||
interface_name = lambda x: os.path.splitext(os.path.basename(x))[0]
|
||||
interfaces_changed_names = map(interface_name, interfaces_changed)
|
||||
|
||||
def affected_by_wdspec(test):
|
||||
affected = False
|
||||
if test in wdspec_test_files:
|
||||
|
@ -252,6 +260,15 @@ def affected_testfiles(files_changed, skip_tests, manifest_path=None):
|
|||
break
|
||||
return affected
|
||||
|
||||
def affected_by_interfaces(file_contents):
|
||||
if len(interfaces_changed_names) > 0:
|
||||
if 'idlharness.js' in file_contents:
|
||||
for interface in interfaces_changed_names:
|
||||
regex = '[\'"]' + interface + '(\\.idl)?[\'"]'
|
||||
if re.search(regex, file_contents):
|
||||
affected_testfiles.add(test_full_path)
|
||||
break
|
||||
|
||||
for root, dirs, fnames in os.walk(wpt_root):
|
||||
# Walk top_level_subdir looking for test files containing either the
|
||||
# relative filepath or absolute filepath to the changed files.
|
||||
|
@ -277,7 +294,7 @@ def affected_testfiles(files_changed, skip_tests, manifest_path=None):
|
|||
file_contents = file_contents.decode("utf8", "replace")
|
||||
for full_path, repo_path in nontest_changed_paths:
|
||||
rel_path = os.path.relpath(full_path, root).replace(os.path.sep, "/")
|
||||
if rel_path in file_contents or repo_path in file_contents:
|
||||
if rel_path in file_contents or repo_path in file_contents or affected_by_interfaces(file_contents):
|
||||
affected_testfiles.add(test_full_path)
|
||||
continue
|
||||
|
||||
|
|
|
@ -389,6 +389,20 @@ def test_tests_affected(capsys, manifest_dir):
|
|||
assert "infrastructure/reftest-wait.html" in out
|
||||
|
||||
|
||||
@pytest.mark.slow # this updates the manifest
|
||||
@pytest.mark.xfail(sys.platform == "win32",
|
||||
reason="Tests currently don't work on Windows for path reasons")
|
||||
@pytest.mark.skipif(sys.platform == "win32",
|
||||
reason="https://github.com/web-platform-tests/wpt/issues/12934")
|
||||
def test_tests_affected_idlharness(capsys, manifest_dir):
|
||||
commit = "47cea8c38b88c0ddd3854e4edec0c5b6f2697e62"
|
||||
with pytest.raises(SystemExit) as excinfo:
|
||||
wpt.main(argv=["tests-affected", "--metadata", manifest_dir, "%s~..%s" % (commit, commit)])
|
||||
assert excinfo.value.code == 0
|
||||
out, err = capsys.readouterr()
|
||||
assert "webrtc/idlharness.https.window.js\n" == out
|
||||
|
||||
|
||||
@pytest.mark.slow # this updates the manifest
|
||||
@pytest.mark.xfail(sys.platform == "win32",
|
||||
reason="Tests currently don't work on Windows for path reasons")
|
||||
|
|
|
@ -39,7 +39,7 @@ def call(*args):
|
|||
|
||||
Returns a bytestring of the subprocess output if no error.
|
||||
"""
|
||||
logger.debug("%s" % " ".join(args))
|
||||
logger.debug(" ".join(args))
|
||||
try:
|
||||
return subprocess.check_output(args)
|
||||
except subprocess.CalledProcessError as e:
|
||||
|
|
|
@ -2,4 +2,4 @@ html5lib == 1.0.1
|
|||
mozinfo == 0.10
|
||||
mozlog==3.9
|
||||
mozdebug == 0.1
|
||||
urllib3[secure]==1.23
|
||||
urllib3[secure]==1.24
|
||||
|
|
|
@ -227,8 +227,9 @@ class FennecBrowser(FirefoxBrowser):
|
|||
if self.runner is not None:
|
||||
try:
|
||||
if self.runner.device.connected:
|
||||
self.runner.device.device.remove_forwards(
|
||||
"tcp:{}".format(self.marionette_port))
|
||||
if len(self.runner.device.device.list_forwards()) > 0:
|
||||
self.runner.device.device.remove_forwards(
|
||||
"tcp:{}".format(self.marionette_port))
|
||||
except Exception:
|
||||
traceback.print_exception(*sys.exc_info())
|
||||
# We assume that stopping the runner prompts the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue