mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 1823464 - [wdspec] Improve serialization tests for DOMTokenList. r=webdriver-reviewers,jdescottes
Depends on D173068 Differential Revision: https://phabricator.services.mozilla.com/D173069
This commit is contained in:
parent
43234ab776
commit
b2e13b6cb8
@ -23,6 +23,17 @@ def test_array(session):
|
||||
assert_success(response, [1, 2])
|
||||
|
||||
|
||||
def test_dom_token_list(session, inline):
|
||||
session.url = inline("""<div class="no cheese">foo</div>""")
|
||||
element = session.find.css("div", all=False)
|
||||
|
||||
response = execute_async_script(
|
||||
session, "arguments[1](arguments[0].classList)", args=[element])
|
||||
value = assert_success(response)
|
||||
|
||||
assert value == ["no", "cheese"]
|
||||
|
||||
|
||||
def test_file_list(session, tmpdir, inline):
|
||||
files = [tmpdir.join("foo.txt"), tmpdir.join("bar.txt")]
|
||||
|
||||
|
@ -19,6 +19,16 @@ def test_array(session):
|
||||
assert_success(response, [1, 2])
|
||||
|
||||
|
||||
def test_dom_token_list(session, inline):
|
||||
session.url = inline("""<div class="no cheese">foo</div>""")
|
||||
element = session.find.css("div", all=False)
|
||||
|
||||
response = execute_script(session, "return arguments[0].classList", args=[element])
|
||||
value = assert_success(response)
|
||||
|
||||
assert value == ["no", "cheese"]
|
||||
|
||||
|
||||
def test_file_list(session, tmpdir, inline):
|
||||
files = [tmpdir.join("foo.txt"), tmpdir.join("bar.txt")]
|
||||
|
||||
|
@ -137,6 +137,16 @@ def test_primitives(session, inline, js_primitive, py_primitive):
|
||||
assert_success(response, py_primitive)
|
||||
|
||||
|
||||
def test_collection_dom_token_list(session, inline):
|
||||
session.url = inline("""<div class="no cheese">""")
|
||||
element = session.find.css("div", all=False)
|
||||
|
||||
response = get_element_property(session, element.id, "classList")
|
||||
value = assert_success(response)
|
||||
|
||||
assert value == ["no", "cheese"]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("js_primitive,py_primitive", [
|
||||
("\"foobar\"", "foobar"),
|
||||
(42, 42),
|
||||
|
Loading…
Reference in New Issue
Block a user