The global message manager reaches all browsers and all frames.
If Marionette was _not_ using the global message manager, this
would have been the correct approach.
MozReview-Commit-ID: HKrlfd9pzK2
--HG--
extra : rebase_source : 8a63a0928af574f27d5612d0cef88e4f3a80481b
The forthcoming window tracking refactoring introduces the new
abstractions ContentContext and ChromeContext that to a large extent
share the same interface. They make it possible to interact with
both types of browsing context in a uniform manner.
Marionette currently has a lot of convoluted if-conditions to
paper over the differences between ChromeWindow, <xul:browser>,
and browser.Context. Examples of this includes the assert.window
and assert.contentBrowser assertions: they essentially perform the
same job, but does not share the same API because the underlying
APIs they call are different.
In an effort to prepare Marionette for the window tracking refactoring,
this patch adds a bit of glue to combine them both into one assertion
called assert.open. This checks that the browsing context has not
been discarded.
MozReview-Commit-ID: K5e7Sr1mq0
Whenever we make proxied IPC calls to the content frame's message manager,
we do so over the global message manager. AsyncMessageChannel takes a
closure that returns the current message manager from GeckoDriver#mm,
but this is unnecessary because it always holds a global message channel.
By not having to pass in a closure returning a message manager
to AsyncMessageChannel we losen the tight coupling a little bit.
Future patches will further reduce the tight coupling of browserFn.
MozReview-Commit-ID: EU0pkxA7lab
--HG--
extra : rebase_source : f6d6735e2d5bacdfbf20bde9a835f3f83846b2d6
The Marionette:newSession IPC message is never used, and the
newSession function is consequently never called. Since we no
longer have a need for resetting the content frame script, like
had with B2G, removing it is probably fine.
This also changes the Marionette:Register command to return an object
with the "outerWindowID" key, making it easier to identify and extract.
MozReview-Commit-ID: Ae3cPFWshcv
--HG--
extra : rebase_source : 056e9f2016317c314b9d46699669bfc76ea0bc37
Prior to this patch Marionette used a broadcasting technique that
sent every IPC message to every registered content frame's message
manager. This was implemented in GeckoDriver#sendAsync and worked
by appending the frame's outerWindowID to the message name to ensure
it reached the correct recipient.
Because it is hugely wasteful for every content frame to receive every IPC
message, this patch changes it so that we use a frame's dedicated message
manager to only channel messages it cares about. A content frame's
direct message manager is stored in browser.Context#messageManager,
whereas GeckoDriver#mm is always the global message manager.
MozReview-Commit-ID: L0sD3VhzStv
--HG--
extra : rebase_source : 3f77075d88036d1e381a1a3fbbd359656838532c
Capabilities are currently sent to the content frame script when
its IPC message listeners attach (on Marionette:ListenersAttached).
If for whatever reason a capability's value changes since the script
was registered, for example by a user calling the WebDriver:SetTimeouts
command, a race condition is introduced where the capabilities in
chrome will differ from those cached in the frame script.
To remove any chance of race conditions, this patch changes the
content frame script to query the capabilities from chrome every time
it needs them. This is slightly less efficient, but should be neglible.
The patch also clears up some unused state, such as the
curBrowser.newSessionCommandId property, which did not appear to
be used for anything interesting.
MozReview-Commit-ID: 1bSrRu5nK3h
--HG--
extra : rebase_source : 06f6fb8e4a6d04e5c4fa56d1becafd55ed0d1dee
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
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
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
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
Closing a tab should always be allowed, even if the current content browser doesn't exist.
This can be the case when a tab gets moved to a different process.
MozReview-Commit-ID: LaU9MgEyCOx
--HG--
extra : rebase_source : 4b49693e0c9acdfc2407bd2f9a41fd501dad8d63
The Browser Testing and Tools group agreed that the webdriver endpoint, when
asserting for a modal, that it clears the modal on the screen and raises an
an Unexpected Alert Open error.
See https://github.com/w3c/webdriver/pull/1145
MozReview-Commit-ID: 1OnT1AMM0tY
--HG--
extra : rebase_source : c8d75074273071fe4d701e69f6044d1ff94eb2f0
The Browser Testing and Tools group agreed that the webdriver endpoint, when
asserting for a modal, that it clears the modal on the screen and raises an
an Unexpected Alert Open error.
See https://github.com/w3c/webdriver/pull/1145
MozReview-Commit-ID: 1OnT1AMM0tY
--HG--
extra : rebase_source : d403cdd98d6ceaf2fc101e9371e4092ceb7558de
on a CLOSED TREE
Backed out changeset dff6393650df (bug 1416284)
Backed out changeset b1474e3a2e94 (bug 1416284)
--HG--
extra : rebase_source : 0877a744252fdb0aeb022fc99fd8b117bdd2b628
The Browser Testing and Tools group agreed that the webdriver endpoint, when
asserting for a modal, that it clears the modal on the screen and raises an
an Unexpected Alert Open error.
See https://github.com/w3c/webdriver/pull/1145
MozReview-Commit-ID: 1OnT1AMM0tY
--HG--
extra : rebase_source : dab2d8b96f3dc1dddb7b22127faf30e9e744b0bc
The Browser Testing and Tools group agreed that the webdriver endpoint, when
asserting for a modal, that it clears the modal on the screen and raises an
an Unexpected Alert Open error.
See https://github.com/w3c/webdriver/pull/1145
MozReview-Commit-ID: 1OnT1AMM0tY
--HG--
extra : rebase_source : a990f0fa5643dc7e844e79b9f344126a49e79665
This is a workaround for https://bugzil.la/1411513 about Log.jsm
not being compatible with E10s. It queries the log level via
synchronous IPC message to the main process.
MozReview-Commit-ID: 5RZluH8Rv9o
--HG--
extra : rebase_source : 7ccf803ec7041a2d910f5697f63ee8f1a978d79f
The "element" field on the WebDriver:SwitchToFrame command request's
body takes a string web element reference UUID as input. This patch
changes it so that it can also take a web element JSON Object.
The old behaviour can be removed with Firefox 60.
MozReview-Commit-ID: JcTD3MRxjOe
--HG--
extra : rebase_source : f313349121787e8f68137132cac49aecebee5ba1
The "element" field on the WebDriver:SwitchToFrame command request's
body takes a string web element reference UUID as input. This patch
changes it so that it can also take a web element JSON Object.
The old behaviour can be removed with Firefox 60.
MozReview-Commit-ID: JcTD3MRxjOe
--HG--
extra : rebase_source : 3da4b30d2689b6416d89bee838df73af40db2686
To avoid circular dependencies, where file A depends on B depending
on A, we should strive towards fewer inter-dependencies and more
autonomy between modules.
For example, if testing/marionette/browser.js needs access to
the Context enum it can currently only attain it by importing
testing/marionette/driver.js. Because driver.js imports browser.js,
we create a circular dependency and Cu.import enters an infinite
import recursion.
MozReview-Commit-ID: LGiA9sy9xrd
--HG--
extra : rebase_source : f1748894c4309a5bc34b72acd4931d7937e8810e
To avoid circular dependencies, where file A depends on B depending
on A, we should strive towards fewer inter-dependencies and more
autonomy between modules.
For example, if testing/marionette/browser.js needs access to
the Context enum it can currently only attain it by importing
testing/marionette/driver.js. Because driver.js imports browser.js,
we create a circular dependency and Cu.import enters an infinite
import recursion.
MozReview-Commit-ID: LGiA9sy9xrd
--HG--
extra : rebase_source : e4b69c91b9cf78705c902f1e5038d815b88114d0
The upcoming window tracking refactoring to Marionette will introduce
a new testing/marionette/wm.js module. It was originally the plan
to move WindowState there after it had landed, but it actually makes
sense to land any dependencies before to reduce churn in the window
tracking patches.
MozReview-Commit-ID: EpqnTYYGcmg
--HG--
extra : rebase_source : d6760feefa49c522738fd3930b339bc0af70e6a5
The issue here was that the cookie domain was always prepended with
'.' character. To resolve this edge-case Marionette now first checks
whether the cookie domain is in fact an IP address.
MozReview-Commit-ID: 4xBd4rscXxx
--HG--
extra : rebase_source : 92bf20ceb43c05f4610e3e0a5411027300586784
The Delete Cookie command should not return an error if the cookie
does not exist.
The variable names "toDelete" and "candidateName" was also
juxtapositioned and wrong. Here I am using the approximate names
used in the specification prose for clarity.
Fixes: https://github.com/mozilla/geckodriver/issues/989
MozReview-Commit-ID: 6IIGGpB1JWn
--HG--
extra : rebase_source : f3149d2195c0e871370eef3d2c1306a8212c5751
In formalising our synchronisation module, this renames wait.until
to PollPromise. It is a specialisation of a promise, just like
TimedPromise, that poll-waits a condition for a given amount of time
before either resolving (passing) or rejecting (failing) the poll-wait.
Also fix and improve documentation.
MozReview-Commit-ID: AcP3C1qCgKA
--HG--
extra : rebase_source : d17bb3be0819b0ce9de55d44741836fc00b10f46
testing/marionette/wait.js originally contained a utility for
poll-waiting on a condition. The module has since been expanded to
also include TimedPromise, which is a specialisation of Promise that
is rejected after a duration.
The latter is not a wait utility but a synchronisation primitive.
This terminology also covers the first, and this change renames the
wait module to sync.
MozReview-Commit-ID: Fd3LqfpiEaU
--HG--
rename : testing/marionette/wait.js => testing/marionette/sync.js
extra : rebase_source : f48ff62ca2589ab0ce4a2f3d134d392e6f0be015
Now that we have selective imports through Cu.import we can give
wait.until a more descriptive name that matches TimedPromise.
This patch renames the wait.until utility to PollPromise.
MozReview-Commit-ID: 9gsvAV27mMl
--HG--
extra : rebase_source : ea98d63013d709d52ce234446404233d9dbe572e
testing/marionette/wait.js originally contained a utility for
poll-waiting on a condition. The module has since been expanded to
also include TimedPromise, which is a specialisation of Promise that
is rejected after a duration.
The latter is not a wait utility but a synchronisation primitive.
This terminology also covers the first, and this change renames the
wait module to sync.
MozReview-Commit-ID: Fd3LqfpiEaU
--HG--
rename : testing/marionette/wait.js => testing/marionette/sync.js
extra : rebase_source : 5e22ec5e26b5405c928ab26734a8d2ddc5d43785