mirror of
https://github.com/servo/servo.git
synced 2025-08-14 09:55:35 +01:00
Update web-platform-tests to revision 50d6ee076e94273080d9f3b69be0bf4eeae156d3
This commit is contained in:
parent
3b9055510a
commit
280c87822d
331 changed files with 4209 additions and 866 deletions
|
@ -0,0 +1,51 @@
|
|||
import pytest
|
||||
|
||||
from tests.support.asserts import assert_error, assert_success
|
||||
|
||||
|
||||
def perform_actions(session, actions):
|
||||
return session.transport.send(
|
||||
"POST",
|
||||
"/session/{session_id}/actions".format(session_id=session.session_id),
|
||||
{"actions": actions})
|
||||
|
||||
|
||||
@pytest.mark.parametrize("action_type", ["none", "key", "pointer"])
|
||||
def test_pause_positive_integer(session, action_type):
|
||||
for valid_duration in [0, 1]:
|
||||
actions = [{
|
||||
"type": action_type,
|
||||
"id": "foobar",
|
||||
"actions": [{
|
||||
"type": "pause",
|
||||
"duration": valid_duration
|
||||
}]
|
||||
}]
|
||||
response = perform_actions(session, actions)
|
||||
assert_success(response)
|
||||
|
||||
actions = [{
|
||||
"type": action_type,
|
||||
"id": "foobar",
|
||||
"actions": [{
|
||||
"type": "pause",
|
||||
"duration": -1
|
||||
}]
|
||||
}]
|
||||
response = perform_actions(session, actions)
|
||||
assert_error(response, "invalid argument")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("action_type", ["none", "key", "pointer"])
|
||||
def test_pause_invalid_types(session, action_type):
|
||||
for invalid_type in [0.0, None, "foo", True, [], {}]:
|
||||
actions = [{
|
||||
"type": action_type,
|
||||
"id": "foobar",
|
||||
"actions": [{
|
||||
"type": "pause",
|
||||
"duration": invalid_type
|
||||
}]
|
||||
}]
|
||||
response = perform_actions(session, actions)
|
||||
assert_error(response, "invalid argument")
|
|
@ -13,6 +13,7 @@ def test_null_response_value(session):
|
|||
response = delete_session(session)
|
||||
value = assert_success(response)
|
||||
assert value is None
|
||||
|
||||
# Need an explicit call to session.end() to notify the test harness
|
||||
# that a new session needs to be created for subsequent tests.
|
||||
session.end()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue