mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Update web-platform-tests and CSS tests.
- Update CSS tests to revision e05bfd5e30ed662c2f8a353577003f8eed230180. - Update web-platform-tests to revision a052787dd5c069a340031011196b73affbd68cd9.
This commit is contained in:
parent
fb4f421c8b
commit
296fa2512b
21852 changed files with 2080936 additions and 892894 deletions
39
tests/wpt/web-platform-tests/webdriver/conftest.py
Normal file
39
tests/wpt/web-platform-tests/webdriver/conftest.py
Normal file
|
@ -0,0 +1,39 @@
|
|||
import os
|
||||
|
||||
import pytest
|
||||
import webdriver
|
||||
|
||||
from util import cleanup
|
||||
from util.http_request import HTTPRequest
|
||||
|
||||
default_host = "http://127.0.0.1"
|
||||
default_port = "4444"
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def _session(request):
|
||||
host = os.environ.get("WD_HOST", default_host)
|
||||
port = int(os.environ.get("WD_PORT", default_port))
|
||||
|
||||
session = webdriver.Session(host, port)
|
||||
|
||||
def destroy():
|
||||
if session.session_id is not None:
|
||||
session.end()
|
||||
|
||||
request.addfinalizer(destroy)
|
||||
|
||||
return session
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def session(_session, request):
|
||||
# finalisers are popped off a stack,
|
||||
# making their ordering reverse
|
||||
request.addfinalizer(lambda: cleanup.switch_to_top_level_browsing_context(_session))
|
||||
request.addfinalizer(lambda: cleanup.restore_windows(_session))
|
||||
request.addfinalizer(lambda: cleanup.dismiss_user_prompts(_session))
|
||||
|
||||
return _session
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def http(session):
|
||||
return HTTPRequest(session.transport.host, session.transport.port)
|
Loading…
Add table
Add a link
Reference in a new issue