Skip to content

Commit

Permalink
[wdspec] Remove test cases for "permissions.setPermission" command wh…
Browse files Browse the repository at this point in the history
…ich are invalid for Firefox.

Differential Revision: https://phabricator.services.mozilla.com/D208865

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1875065
gecko-commit: c84d4a64a938632a3d8f07152a363297346fc1d0
gecko-reviewers: webdriver-reviewers, whimboo, jdescottes
  • Loading branch information
lutien authored and moz-wptsync-bot committed May 10, 2024
1 parent ff3d4af commit 6c77067
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

pytestmark = pytest.mark.asyncio


@pytest.mark.parametrize("descriptor", [False, "SOME_STRING", 42, {}, [], {"name": 23}, None, UNDEFINED])
async def test_params_descriptor_invalid_type(bidi_session, descriptor):
with pytest.raises(error.InvalidArgumentException):
Expand Down Expand Up @@ -54,8 +55,8 @@ async def test_params_origin_invalid_type(bidi_session, origin):
)


@pytest.mark.parametrize("user_context", [False, 42, {}, [], None])
async def test_params_origin_invalid_type(bidi_session, user_context):
@pytest.mark.parametrize("user_context", [False, 42, {}, []])
async def test_params_user_context_invalid_type(bidi_session, user_context):
with pytest.raises(error.InvalidArgumentException):
await bidi_session.permissions.set_permission(
descriptor={"name": "geolocation"},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import pytest
import webdriver.bidi.error as error

from . import get_context_origin, get_permission_state

pytestmark = pytest.mark.asyncio


@pytest.mark.asyncio
async def test_set_permission(bidi_session, new_tab, url):
test_url = url("/common/blank.html", protocol="https")
Expand Down Expand Up @@ -43,24 +43,6 @@ async def test_set_permission(bidi_session, new_tab, url):
assert await get_permission_state(bidi_session, new_tab, "geolocation") == "prompt"


@pytest.mark.asyncio
async def test_set_permission_insecure_context(bidi_session, new_tab, url):
test_url = url("/common/blank.html", protocol="http")
await bidi_session.browsing_context.navigate(
context=new_tab["context"],
url=test_url,
wait="complete",
)

origin = await get_context_origin(bidi_session, new_tab)

with pytest.raises(error.InvalidArgumentException):
await bidi_session.permissions.set_permission(
descriptor={"name": "push"},
state="granted",
origin=origin,
)

@pytest.mark.asyncio
async def test_set_permission_new_context(bidi_session, new_tab, url):
test_url = url("/common/blank.html", protocol="https")
Expand Down

0 comments on commit 6c77067

Please sign in to comment.