Bug 1773264 - Refactor actions support, r=webdriver-reviewers,whimboo
commit159ca0c579e84cf3afe586b123b1ee94153c44cf
authorJames Graham <james@hoppipolla.co.uk>
Mon, 13 Jun 2022 09:03:33 +0000 (13 09:03 +0000)
committerJames Graham <james@hoppipolla.co.uk>
Mon, 13 Jun 2022 09:03:33 +0000 (13 09:03 +0000)
tree54ff2bd081c615329e88294978be871a7246059b
parent71cf07a3d292d2466952a5f7cb37275510620117
Bug 1773264 - Refactor actions support, r=webdriver-reviewers,whimboo

Move from having lots of switch/case statements to dispatch the
correct actions to a more normal OO setup where each action type is
represented by a class with a static fromJSON method for construction,
and a `dispatch()` method for emitting the event.

The state is also passed around explictly rather than being stored in
a module global. This will allow us to have e.g. different state per
session.

Differential Revision: https://phabricator.services.mozilla.com/D139119
remote/marionette/action.js
remote/marionette/actors/MarionetteCommandsChild.jsm
remote/marionette/driver.js
remote/marionette/event.js
remote/marionette/test/xpcshell/test_action.js
remote/shared/webdriver/Assert.jsm