This removes the last remenants of frame.Manager and
testing/marionette/frame.js from Marionette. The preceding commits
in this changeset has gradually removed the unused and duplicated
features that it implemented. The only remaining pieces are the
registrating of some chrome-side IPC message handlers which we can
leave attached for the duration of the Marionette session.
MozReview-Commit-ID: EYjrJBeTybz
--HG--
extra : rebase_source : cf8b2d04c05d22eea6fe24061ccb9b21680f0d3c
This removes the Marionette:emitTouchEvent IPC message which is
currently not in use by any tests. Along with removing this message
listener we can get rid of a tonne of complicated infrastructure
in testing/marionette/frame.js.
On switching the content frame we no longer await frame scripts to
register themselves because they implicitly inherit the parent's
frame script in Firefox/Fennec. This was a relic from the B2G days
when each frame was OOP.
MozReview-Commit-ID: 5vxrWHjzd68
--HG--
extra : rebase_source : 544013f42c9ee9eebb119b8d98061d997c7a10f0
It turns out that we no longer need to guard against the browser/frame
closing when using the legacy actions module. This means we can
get rid of GeckoDriver#addFrameCloseListener, which again populates
mozBrowserClose and adds handlers for the related mozbrowserclose event.
The mozbrowsercloseevent was set for every case of Marionette:ok,
Marionette:done, and Marionette:error IPC messages. These events
are still in use in testing/marionette/proxy.js, but with this
patch we stop listening for these events in testing/marionette/driver.js.
MozReview-Commit-ID: jp34kh7nqD
--HG--
extra : rebase_source : b9551972717c9c399806b7c7e1e2a1adc99593c5
The IPC message "aliveCheck" will always fail because there is no such
message handler in Marionette and because it swallows all thrown errors.
MozReview-Commit-ID: JISuK65ZcGM
--HG--
extra : rebase_source : e4ccbb96727a67ce11f31463a08f66768bd23589
The MarionetteFrame:getCurrentFrameId IPC message was used for B2G
applications that needed access to chrome-scoped APIs for emitting
touch events. Now that actions happen either in chrome _or_ in
content this is no longer necessary functionality to maintain.
MozReview-Commit-ID: Bk9LRAOxjAw
--HG--
extra : rebase_source : 71dac090db681a24dc5ebb54fdf1cf02a97563b0
MarionetteFrame:getInterruptedState was used in B2G to abortence
if the OOP frame got interrupted by a modal dialogue. Like the
MarionetteFrame:handleModal IPC message, the frame script needed
chrome assistance for querying the presence of this dialogue.
Today modal dialogues (known as "user prompts") are handled entirely
in chrome space, and the presence of such a dialogue is indeed
meant to pause script execution in the web document.
This patch makes some rather questionable changes to the legacyaction
module, but this is alright because we don't expect any more tests to
be written using it. This patch just about makes sure the remaining
body of tests keeps passing.
MozReview-Commit-ID: 72g0GlYy21T
--HG--
extra : rebase_source : f44ed5999554a42c67827d6935bd96cc79a8e5dd
The MarionetteFrame:handleModal IPC message is not used in listener.js,
and it is no longer a requirement that this is done through a call
from the content frame script.
MozReview-Commit-ID: Bn40b1VT7Da
--HG--
extra : rebase_source : 9def3f7faa5f860622259bd85982e1072b436be0
The Marionette:shareData IPC message was used by the simpletest
harness to share test logs with the main process. This is no longer
a requirement.
MozReview-Commit-ID: 4nn7FefCdJ8
--HG--
extra : rebase_source : 44d8334c4a116d7056ee7a938fdf900e350d73f2
We used to transport log messages to the main process for logging.
This is no longer required and the IPC message has not been in use
for some time.
MozReview-Commit-ID: F5thqDOJADd
--HG--
extra : rebase_source : b1ba930cc870655398f7024213c77cb6b93113c9
In B2G, when a frame was interrupted by a modal dialogue, the
Marionette:switchToModalOrigin IPC message allowed you to switch
back to the frame that was interrupted. It got called by the
interrupted frame once the dialogue got dismissed and the frame
resumed its process. This functionality is no longer requried.
MozReview-Commit-ID: DtCOzeW45qP
--HG--
extra : rebase_source : 46ed3841abc53e0369246625d16839e9b2576d39
Marionette has a Marionette:sleepSession IPC command it uses to put a
content frame script "to sleep". This removes certain message handlers
and clears some state by calling deleteSession() in listener.js.
The frame script can later be "restarted" by calling Marionette:restart.
This is B2G-specific functionality we no longer need. In an effort
to remove old cruft from Marionette before tackling the window
tracking refactoring we want to remove support for this.
This removes the Marionette:sleepSession and Marionette:restart
IPC messages as well as GeckoDriver#switchToGlobalMessageManager.
The latter function additionally resets GeckoDriver#mm to the global
message manager which is fine, because for Firefox/Fennec we never
use the targetted message manager.
There will be a follow-up bug to remove OOP frame handling and the
targetted message manager used in GeckoDriver#sendAsync.
MozReview-Commit-ID: GRSBReBfQGX
--HG--
extra : rebase_source : 9f5ff562e3547ee804ec350678cb688f2cf1b4fa
When Marionette starts and shuts down it emits the remote-active
system notification. On starting the data is set to true (a boolean),
but on shutdown it is left undefined which defaults to null.
We should use false (boolean) explicitly.
MozReview-Commit-ID: Er0Wn2pZrOi
--HG--
extra : rebase_source : 35d1f7ab471309a25d660c056deb6f69821e40c2
The remote-active system notification is currently sent before the
TCP socket has stopped listening. It is marginally safer to send
it as the last action.
MozReview-Commit-ID: KhB6TMvyCPv
--HG--
extra : rebase_source : 5363c00a8da9217d2f93908c52a466d47fb21d75
Since the crash reporter interface was made available all the time,
the check for the enabled state of the crash reporter had to be made
via AppConstants.jsm
MozReview-Commit-ID: LPkBVEjBB5o
--HG--
extra : rebase_source : eb49d7ca7c457ae1afaafdd9e6364333aebd03bf
The remote-active system notification is currently sent before the
TCP socket has stopped listening. It is marginally safer to send
it as the last action.
MozReview-Commit-ID: KhB6TMvyCPv
Only reporting the basename of the test module doesn't allow someone
to easily figure out where the file is actually located. Instead the
current working directory should be used, and the test module path
reported as relative path.
MozReview-Commit-ID: 8FdYNw4ocjL
--HG--
extra : rebase_source : 338ebdcd34230a9918c6db4297bcc6c91f7c2e77
The harness already logs the start and end of the test via mozlog.
So there is no need to do it twice. Especially because this requires
another command send to Marionette server.
MozReview-Commit-ID: 5JfU9XgbVqx
--HG--
extra : rebase_source : 28947a416bfdda626dd1329522e02264593368b2
Enables webdriver spec keyboard interactability tests for 'Element Send Keys'
by default by re-using the same capability 'moz:webdriverClick' from
'Element Click'. It can be disabled by turning off this preference.
Also various webplatform tests for webdriver spec have been added which
cover both the scroll into view action, and keyboard interactability check.
Existing Marionette unit tests will be run in both modes, until we can
get rid of the legacy mode.
MozReview-Commit-ID: dFB8sQ6CN5
--HG--
extra : rebase_source : 9f6a3c3e42f779f039f61d0b239f9f5925ecdcf5
Each call to sendKeysToElement should go through the interaction
module, and never by directly calling event.sendKeysToElement. This
will make sure that keyboard interactability checks will always be
performed, even for chrome scope like alerts or modal dialogs.
MozReview-Commit-ID: GoDKjMsNZsq
--HG--
extra : rebase_source : c305c748e68e60abd01dab37d00a7e3aff7d3d64
Because with webdriver interactability checks turned on, accessability
checks are done afterward, and like in this case would even never run
due to <h1> is not a keyboard-interactability element, which causes an
ElementNotInteractableException.
As such those obsolete tests can be removed now.
MozReview-Commit-ID: 6pw5TCgMb7l
--HG--
extra : rebase_source : 05a13ac45530c67bc45e16f8ac893e5fa3bf9d51
Both 'test_text.py' and 'test_typing.py' contained nearly duplicated
tests for send_keys(), which have been removed from test_text.py now.
The HTML testcase file 'javaScript.html' was used in various tests
whereby it's initial purpose was to test keyboard events. As such
unit tests have been updated to use inline HTML, or another more
generic HTML testcase file. Also parts of the the file related to
visibility checks have been moved to 'visibility.html'.
MozReview-Commit-ID: CEWPPGdAffW
--HG--
rename : testing/marionette/harness/marionette_harness/www/javascriptPage.html => testing/marionette/harness/marionette_harness/www/keyboard.html
extra : rebase_source : 6a8fc6bfb5e421b4a1d545f8bdc7d9fbd38ef3f3
Enhances format.pprint to also provide pretty-printing of WindowProxy
and ChromeWindow prototypes.
Unfortunately there is no good way of testing this because
Object.prototype.toString.call always gets the underlying prototype.
MozReview-Commit-ID: 5sKzJvpWVyc
--HG--
extra : rebase_source : ca021d78a19c49ad2c2a381832d25c201ee8b2e0
By missing to convert a Javascript object to a packet and serializing
it, no details were printed eg for session capabilities for the call
to "start_session()".
MozReview-Commit-ID: HdcehGpBvdA
--HG--
extra : rebase_source : 7ab6e794972869b89aeb957ae53c703727d84094
Marionette does currently not test for cyclic object references as
it marshals return values for transport across the wire.
Example of cyclic object:
let obj = {};
obj.cyclic = obj;
Passing this through evalaute.toJSON currently causes an infinite
recursion due to obj being referenced inside itself. We can use
JSON.stringify to test if obj contains such cyclic values. It is
assumed that the input to assert.acyclic is already JSON safe, so it can
be parsed by JSON.stringify, because of the previous checks it has made.
MozReview-Commit-ID: 4CnY2dcW5IF
--HG--
extra : rebase_source : e1a5fb595ad487fa47566bad5c2129a79c1d7b34
Introduces a new assert.acyclic assertion helper function that uses
JSON.stringify to test if the input contains cyclic object references.
A JavaScriptError will be thrown if the object is not acyclic.
MozReview-Commit-ID: 3y8pnkPgf2k
--HG--
extra : rebase_source : 069ae9e1e6d3738c8712fe5c1838f6d3a91125e4
Errors that arise from inside sendResponse or sendError are currently
only logged to stdout. Now that we have a pretty safe error.wrap
implementation we should serialise them and return them to the main
process so that they are not "lost" in stdout.
MozReview-Commit-ID: FuMeUqQ7CMv
--HG--
extra : rebase_source : 2d43eb63ec13dbfb461d72dd9ddee232ff4ff9d8
document.activeElement will return null if there is no document
element. This may happen if, for example, in an HTML document the
<body> element is removed.
The WPT test test_sucess_without_body in get_active_element.py
is wrong. It expects Get Active Element to return null if there
is no document element, but following a recent specification change
we want it to return a no such element error.
Specification change: https://github.com/w3c/webdriver/pull/1157
MozReview-Commit-ID: LQJ3slV9aty
--HG--
extra : rebase_source : cc349bb642f57bb2203d126ecd86d8d988d90301
Instead of having to assign resp.body.value explicitly when dealing
with WebElements, this makes it possible to return WebElement
references directly from GeckoDriver command handlers. This was
not possible in the past because web element representations were
just plain object literals.
MozReview-Commit-ID: EPqXJ2gpNen
--HG--
extra : rebase_source : 334a5f4f597259c28b3c00c93f3ad24912d5dd87
If the DOM click event does not fire, which currently happens in
this edge case where Firefox does not bubble the click event up
to <body>, interaction.flushEventLoop will hang forever.
This is believed to be a bug in Gecko, but it is probably safer to
use a TimedPromise here in case anything else bad were to happen.
Thanks-to: Alexei Barantsev <barancev@gmail.com>
MozReview-Commit-ID: KZBdR8zcfJb
--HG--
extra : rebase_source : aba0c4c810a703877d858fa6f4398ad960ece0d1