Bug 1453121 [wpt PR 10404] - Add an infrastructure test for wdspec, a=testonly

Automatic update from web-platform-testsAllow wdspec tests in infrastructure/webdriver

--
Fix WebDriverProtocol to have a base ProtocolPart.

Without this we error when trying to wait(). In practice we could improve
this to checkc if there's a current session and use that, but this
minimally unbreaks things.

--
Add an infrastructure test for wdspec.

This just tries to load a file to check things aren't totally broken. In
theory we could test each fixture this way.

--

wpt-commits: 82619468f0526e525701c06cf14dea46f814fb17, 564cfb3a6bd13e949d5c49ad6e5f2cb3752173f3, 43cf85f11df472ff032a5184429039a45614a427
wpt-pr: 10404
This commit is contained in:
James Graham 2018-04-29 20:20:32 +00:00 коммит произвёл moz-wptsync-bot
Родитель b5f838cabe
Коммит 27f872a362
5 изменённых файлов: 35 добавлений и 2 удалений

Просмотреть файл

@ -286730,6 +286730,11 @@
{}
]
],
"infrastructure/webdriver/tests/conftest.py": [
[
{}
]
],
"innerText/getter-tests.js": [
[
{}
@ -394431,6 +394436,12 @@
]
},
"wdspec": {
"infrastructure/webdriver/tests/test_load_file.py": [
[
"/infrastructure/webdriver/tests/test_load_file.py",
{}
]
],
"webdriver/tests/actions/key.py": [
[
"/webdriver/tests/actions/key.py",
@ -577318,6 +577329,14 @@
"f2ede647416d150d7cd3720719f386b9f4d5fb6c",
"testharness"
],
"infrastructure/webdriver/tests/conftest.py": [
"6d9586273b0fd6c4bc1cc697402bb86af58f4d8c",
"support"
],
"infrastructure/webdriver/tests/test_load_file.py": [
"c11d6b875af47f6134c98a23a7d2ce4fe4baa8c2",
"wdspec"
],
"innerText/getter-tests.js": [
"42f3e48763297d3360c1074a7c2b706a6f539d37",
"support"

Просмотреть файл

@ -0,0 +1,7 @@
import os
import sys
# Hack to avoid duplicating the conftest file
wdpath = os.path.abspath(os.path.join(os.path.dirname(__file__),
"../../../webdriver/"))
sys.path.insert(0, wdpath)
from tests.conftest import *

Просмотреть файл

@ -0,0 +1,4 @@
from tests.support.inline import inline
def test_load(session):
inline("PASS")

Просмотреть файл

@ -225,8 +225,9 @@ class SourceFile(object):
# wdspec tests are in subdirectories of /webdriver excluding __init__.py
# files.
rel_dir_tree = self.rel_path.split(os.path.sep)
return (rel_dir_tree[0] == "webdriver" and
len(rel_dir_tree) > 1 and
return (((rel_dir_tree[0] == "webdriver" and len(rel_dir_tree) > 1) or
(rel_dir_tree[:2] == ["infrastructure", "webdriver"] and
len(rel_dir_tree) > 2)) and
self.filename not in ("__init__.py", "conftest.py") and
fnmatch(self.filename, wd_pattern))

Просмотреть файл

@ -438,6 +438,8 @@ class ConnectionlessProtocol(Protocol):
class WebDriverProtocol(Protocol):
server_cls = None
implements = [ConnectionlessBaseProtocolPart]
def __init__(self, executor, browser):
Protocol.__init__(self, executor, browser)
self.webdriver_binary = executor.webdriver_binary