mirror of
https://github.com/servo/servo.git
synced 2025-08-15 18:35:33 +01:00
Update web-platform-tests to revision ade06500869396f7a46b95bc3553af4ca9c07f31
This commit is contained in:
parent
9a0404ac5f
commit
ed390a659c
51 changed files with 531 additions and 1075 deletions
|
@ -4,6 +4,7 @@ import os
|
|||
import ssl
|
||||
|
||||
import html5lib
|
||||
import py
|
||||
import pytest
|
||||
from selenium import webdriver
|
||||
from six import text_type
|
||||
|
@ -16,9 +17,11 @@ WPT_ROOT = os.path.normpath(os.path.join(HERE, '..', '..'))
|
|||
HARNESS = os.path.join(HERE, 'harness.html')
|
||||
TEST_TYPES = ('functional', 'unit')
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
parser.addoption("--binary", action="store", default=None, help="path to browser binary")
|
||||
|
||||
|
||||
def pytest_collect_file(path, parent):
|
||||
if path.ext.lower() != '.html':
|
||||
return
|
||||
|
@ -28,6 +31,7 @@ def pytest_collect_file(path, parent):
|
|||
|
||||
return HTMLItem(str(path), test_type, parent)
|
||||
|
||||
|
||||
def pytest_configure(config):
|
||||
config.driver = webdriver.Firefox(firefox_binary=config.getoption("--binary"))
|
||||
config.add_cleanup(config.driver.quit)
|
||||
|
@ -46,6 +50,7 @@ def pytest_configure(config):
|
|||
config.ssl_context = ssl._create_unverified_context()
|
||||
config.add_cleanup(config.server.stop)
|
||||
|
||||
|
||||
def resolve_uri(context, uri):
|
||||
if uri.startswith('/'):
|
||||
base = WPT_ROOT
|
||||
|
@ -56,6 +61,7 @@ def resolve_uri(context, uri):
|
|||
|
||||
return os.path.exists(os.path.join(base, path))
|
||||
|
||||
|
||||
class HTMLItem(pytest.Item, pytest.Collector):
|
||||
def __init__(self, filename, test_type, parent):
|
||||
self.url = parent.session.config.server.url(filename)
|
||||
|
@ -116,7 +122,7 @@ class HTMLItem(pytest.Item, pytest.Collector):
|
|||
# This cannot use super(HTMLItem, self).__init__(..) because only the
|
||||
# Collector constructor takes the fspath argument.
|
||||
pytest.Item.__init__(self, name, parent)
|
||||
pytest.Collector.__init__(self, name, parent, fspath=filename)
|
||||
pytest.Collector.__init__(self, name, parent, fspath=py.path.local(filename))
|
||||
|
||||
|
||||
def reportinfo(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue