зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1741854 - [webdriver-bidi] Prevent internal methods from being called via the WebSocket connection. r=webdriver-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D140038
This commit is contained in:
Родитель
619a501c21
Коммит
23f58e65d5
|
@ -171,6 +171,11 @@ class WebDriverBiDiConnection extends WebSocketConnection {
|
|||
} else {
|
||||
assert.session(this.session);
|
||||
|
||||
// Bug 1741854 - Workaround to deny internal methods to be called
|
||||
if (command.startsWith("_")) {
|
||||
throw new error.UnknownCommandError(method);
|
||||
}
|
||||
|
||||
// Finally, instruct the session to execute the command
|
||||
result = await this.session.execute(module, command, params);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
[errors.py]
|
||||
disabled:
|
||||
if release_or_beta: https://bugzilla.mozilla.org/show_bug.cgi?id=1712902
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
import pytest
|
||||
|
||||
from webdriver.bidi.error import UnknownCommandException
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_internal_method(bidi_session, send_blocking_command):
|
||||
with pytest.raises(UnknownCommandException):
|
||||
await send_blocking_command("log._applySessionData", {})
|
|
@ -9,5 +9,6 @@ sys.path.insert(0, os.path.join(webdriver_path))
|
|||
|
||||
pytest_plugins = [
|
||||
"tests.support.fixtures",
|
||||
"tests.support.fixtures_bidi",
|
||||
"tests.support.fixtures_http",
|
||||
]
|
||||
|
|
Загрузка…
Ссылка в новой задаче