Replace direct invocations of Log.jsm with the new Marionette-specific
logger.
The patch also moves the Log.get() call to a lazy getter.
MozReview-Commit-ID: H1HoAgL2Cvs
--HG--
extra : rebase_source : 0e20a5c0100a359c8d8b627457fc178293387078
Calling Cu.importGlobalProperties immediately defines the import
properties and any prototypes that they require. Aside from CPU
overhead, this also tends to consume a lot of memory, especially
for objects with complex prototypes. And it does this once for
every global you call it in. This is especially a problem for
content processes, since we get this memory overhead in each and
every content process.
This patch moves Marionette to use the new
XPCOMUtils.defineLazyGlobalGetters so that symbols are constructed
only when actually needed.
MozReview-Commit-ID: 3RYWTcdO7FM
--HG--
extra : rebase_source : 0c450c8900e5de5446796b34ae4ab6bdf0fe9118
When evaluating if an object can be null, which would mean that we would
not be able to pass through IPC as, the commandId could not be added to null.
This patch makes sure that we can still send commands via IPC if the object is
evaluated to null.
MozReview-Commit-ID: Fl3Ionj08Sk
--HG--
extra : rebase_source : 33d015ac235ee74e903e13e234c55fda298f8e66
WebDriver commands which do not return a value have to send null.
But currently Marionette returns an empty object.
MozReview-Commit-ID: FILv9IkojIj
--HG--
extra : rebase_source : d3a59c5bd3ce2a33c0a52e2a413364b5e54f9140
As a workaround for bug 1411513, about Log.jsm not supporting E10s,
testing/marionette/listener.js makes a synchronous call (sendSyncMessage)
to the main process asking for the Marionette logger repository's level.
We can avoid this blocking operation by using initialProcessData,
which is new since the workaround was implemented.
initialProcessData is a dictionary structured clone serialisable
that gets copied to the content process when it starts. Because the
Marionette log level cannot be changed at runtime it should be fine
to only send this data once per child process.
MozReview-Commit-ID: 3czydqGZpZH
--HG--
extra : rebase_source : 1aaae676d2b56c609844238e8173b64d300e3e00
This also removes any redundant Ci.nsISupports elements in the interface
lists.
This was done using the following script:
acecb401b7/processors/chromeutils-generateQI.jsm
MozReview-Commit-ID: AIx10P8GpZY
--HG--
extra : rebase_source : a29c07530586dc18ba040f19215475ac20fcfb3b
In addition to the way symbols are exposed, this patch makes a few
changes to what is exposed. Unexposing currentOverride and the
error override bitmasks should not cause any problems.
MozReview-Commit-ID: 9CWZHVyAKbg
--HG--
extra : rebase_source : 6411f842c1eec26661cbe6f4d9e821904ffc4811
This does not really functionally change anything, but it prevents
us from polluting the global space in testing/marionette/driver.js.
MozReview-Commit-ID: Guwt3g0lS8q
--HG--
extra : rebase_source : ad2c38e51d54b7c4ead6b8d6a49d05a0dfef7c6c
The WebDriver:ExecuteScript and WebDriver:ExecuteAsyncScript commands
accepts a "debug_script" parameter that attaches an error handler
on the WindowProxy in the sandbox.
This used to be necessary because the error handler used to be
attached to the content window instead of the sandbox.
MozReview-Commit-ID: ImRVkC5T75O
--HG--
extra : rebase_source : c13c33b4d708879f66bd906f431157720842690c
The evaluate.sandbox function accepts a directInject argument,
which is a relic from Marionette's B2G past when it did not support
evaluating scripts with lasting side-effects.
The API documentation in GeckoDriver#execute_ mentions directInject as a
valid parameter, but it is not picked up or passed on to evaluate.sandbox.
This effectively means the directInject functionality is unused.
MozReview-Commit-ID: 3rYjRQ2R5GV
--HG--
extra : rebase_source : b0c58077de0d7320d2bd1cc55d1af1b959ecaccf
All chrome context related commands have to use the "Marionette"
prefix. For those commands which accidentally have been put under
the "WebDriver" prefix a fallback to the old command is needed
in the Marionette client.
Also update related comments about possible removal dates.
MozReview-Commit-ID: IZLL6pineSO
--HG--
extra : rebase_source : 7e4cbe604d1f0b35cce01173a438b898658018b3
To be consistent with the spec the command should be named
"WebDriver:AcceptAlert".
MozReview-Commit-ID: HGB9hJPAvcU
--HG--
extra : rebase_source : bbf3d657901784e1ab6e096edf1b20a5c43b0176
Adds type checks for the WebDriver:ExecuteScript and
WebDriver:ExecuteAsyncScript commands. This should help prevent
accidental programming mistakes with the Marionette Python client.
MozReview-Commit-ID: JjKgG9OWrdL
--HG--
extra : rebase_source : cd652717f6d4b98d396386e2b971d51a7e737725
To match the WebDriver specification error code names, this patch
renames the NoAlertOpenError type to NoSuchAlertError.
Its string error code (the status property) is still correct.
MozReview-Commit-ID: DhWz1tn6DsT
--HG--
extra : rebase_source : dd45387a5869a8df53f20baafe1c683c3af32b25
To match the WebDriver specification error code names, this patch
renames the NoAlertOpenError type to NoSuchAlertError.
Its string error code (the status property) is still correct.
MozReview-Commit-ID: DhWz1tn6DsT
--HG--
extra : rebase_source : b3da69e566f190c1a016dad7fccf655966779ab1
This flag is used to turn off the WebDriver spec conforming pointer origin
calculation. It has to be kept until all Selenium bindings can successfully
handle the WebDriver spec conforming Pointer Origin calculation.
MozReview-Commit-ID: 3YknXlWoyi1
--HG--
extra : rebase_source : 6df2af027e7458fd29658d7a3bbe99634b6f58f9
This patch was autogenerated by my decomponents.py
It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.
It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.
It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)
MozReview-Commit-ID: DeSHcClQ7cG
--HG--
extra : rebase_source : d9c41878036c1ef7766ef5e91a7005025bc1d72b
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm
MozReview-Commit-ID: 1Nc3XDu0wGl
--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
extra : intermediate-source : 34c999fa006bffe8705cf50c54708aa21a962e62
extra : histedit_source : b2be2c5e5d226e6c347312456a6ae339c1e634b0
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm
MozReview-Commit-ID: 1Nc3XDu0wGl
--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm
MozReview-Commit-ID: 1Nc3XDu0wGl
--HG--
extra : rebase_source : c004a023389f1f6bf3d2f3efe93c13d423b23ccd
The Marionette:getVisibleCookies IPC message listener is not used.
MozReview-Commit-ID: G1N0F8jdLHH
--HG--
extra : rebase_source : 08e40fceae3d2a88c2ae88760d37c00bd8aecbca
This moves the WindowState enum from testing/marionette/wm.js to
testing/marionette/browser.js in order to make it easier to apply
the forthcoming Marionette window tracking refactoring patches.
In other words, this patch functionally does not change anything.
MozReview-Commit-ID: 53MKIRHl11p
--HG--
extra : rebase_source : d048086ab48449ba02853076451e6dd1909bafa6
This moves the WindowState enum from testing/marionette/wm.js to
testing/marionette/browser.js in order to make it easier to apply
the forthcoming Marionette window tracking refactoring patches.
In other words, this patch functionally does not change anything.
MozReview-Commit-ID: 53MKIRHl11p
--HG--
extra : rebase_source : 1d0dcbac2c5089a0b9249794548dee7506b6b568
With the forthcoming window tracking changes the message listeners of
the content frame script are left listening for the duration of the
Marionette lifetime, and not for the duration of the Marionette session.
To prepare for the window tracking refactoring, we will want to
remove message listeners separately from clearing the session state.
Functionally, this patch changes nothing in Marionette for the moment,
except we send two IPC messages to the frame script instead of one.
MozReview-Commit-ID: DwVBCpvk9V9
--HG--
extra : rebase_source : d473a51209eeaf20967303af5aec7376e38fd283
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
The sizemodechange event is not strongly connected to the
visibilitychange event that the WPT minimize_window.py test is now
using to ascertain whether the window has been successfully iconified.
Because Marionette uses the sizemodechange event it is causing
intermittents such as https://bugzil.la/1397007. You can also read a
lengthy summary I did on the problem in https://bugzil.la/1397007#c11.
The fix for the problem is to wait for the visibilitychange DOM
event content.
MozReview-Commit-ID: B6i33Ee5iMC
When maximizing the window we must restore it from iconified state or
exit fullscreen first. Likewise for minimizing the window, we must
exit fullscreen. For fullscreening the window we need to also restore
the window.
MozReview-Commit-ID: AOQX2cV2C75
--HG--
extra : rebase_source : 53f310cc261a9a411bc46a04dd50a160a930b5af
To allow geckodriver to temporarily opt-in for using the webdriver
conforming click, a new custom capability has to be created for
Marionette. If not specified the legacy clickElement method will
be used instead.
MozReview-Commit-ID: LuyTjLJXMGL
--HG--
extra : rebase_source : 8e133fb2d9767ea580468013fedff5233fd8eb93
It turns out that Node.isConnected (described in
https://dom.spec.whatwg.org/#dom-node-isconnected) handles an element’s
shadow root, which element.isDisconnected tries to replicate.
element.isDisconnected and element.isStale are both long and error-prone
and can be removed entirely in favour of this web platform API.
The relevant change to the WebDriver specification landed in
32a477b023.
MozReview-Commit-ID: 5Q0gWLvw8KL
--HG--
extra : rebase_source : 773ab302df27cf11be6079f918a48d3730ceb5c1
The WebDriver spec has been changed a while ago in regard of how
proxy capabilities are getting specified. It means that the port
is no longer its own key but an optional suffix for each of the
ftpProxy, httpProxy, sslProxy, and socksProxy keys.
MozReview-Commit-ID: zdYnVZSf09
--HG--
extra : rebase_source : c4928e6170b52a0ee247f50861646ec29a56bd34
nsIDOMWindow is the XPCOM interface and not what we mean in all these
cases. We either want to refer to the ChromeWindow or to the WindowProxy,
depending on the context of the code.
MozReview-Commit-ID: 405po1XLXRi
--HG--
extra : rebase_source : 47a179f7caed76592dab28f8e10550cda5fe3d02
The other window state manipulation commands are named minimizeWindow
and maximizeWindow.
MozReview-Commit-ID: IBVqJSRwG8x
--HG--
extra : rebase_source : a1efaf7cf2a5c068b62c60453b1f8814d34b043b
The other window state manipulation commands are named minimizeWindow
and maximizeWindow.
MozReview-Commit-ID: IBVqJSRwG8x
--HG--
extra : rebase_source : 29271a475a847ca15c1d8f736520b238c0818791
If the window is minimized when setting the window rect, restore it
before resizing or moving the window. We already exit fullscreen,
so this brings parity to the WebDriver:SetWindowRect command.
MozReview-Commit-ID: KrvWJjKX1eA
--HG--
extra : rebase_source : 968317ae961c8292edbadf2b4cfe439b7dc11f56
geckodriver sends capabilities as a JSON Object in the body of the
command, like this:
[0,1,"newSession",{"acceptInsecureCerts":true}]
With https://bugzil.la/1387380 we wanted the Marionette Python client
to match this behaviour, however the patch overlooked the fact that
the server reads cmd.parameters.capabilities, meaning it looks for a
"capabilities" field on this object instead of treating the object as
the dictionary of capabilities.
As a follow-up to that bug, this patch removes the ability to override
the session ID by specifying a "sessionId" field. This functionality
was only used for in-app restart tests. When Firefox restarts, the
Marionette session is arguably not the same, and sessions should not
live on between restarts.
This patch will fix capabilities passed from geckodriver and align the
Marionette Python client.
For backwards compatibility reasons, it needs to be possible to use the
Python client with older Firefoxen that reads cmd.parameters.capabilities
instead of cmd.parameters. This is why we duplicate the capabilities
object, like geckodriver does.
MozReview-Commit-ID: DCpaxl9hOLe
The geckodriver HTTPD proxy implements WebDriver conforming capabilities
negotation and it is unnecessary to do this in the Marionette WebDriver
service. The capabilities matching that Marionette implements is also
not as good as the implementation found in geckodriver.
The WebDriver:NewSession command will still accept a JSON Object of
"configuration" capabilities that carry the pre-matched capabilities from
geckodriver. These will be used as configuration options for the session.
Type- and bounds checks will still be performed on this input.
MozReview-Commit-ID: CROjgGuTXOG
--HG--
extra : rebase_source : eb7e9f69fe3b23b77ea497d758fe30ac93d6373c
The WebDriver service in the remote protocol accepts sessionId and
session_id and we only need on. All known consumers are using sessionId,
and we can drop the session_id fallback.
MozReview-Commit-ID: 6fa5Lgkzwfu
The element click functions in testing/marionette/interaction.js are
generator functions using "yield". This patch converts them to async
functions.
MozReview-Commit-ID: 4A4cTaY619w
Because the sizemodechange event is not synchronous on all platforms,
we additionally need to await the window's dimensions to change.
However, if the window manager does not have a notion of a maximised
state, this operation too could time out. However, it is believed
that the additional wait will allow for the window to transition to the
required state in this scenario.
MozReview-Commit-ID: KeHJMKSJfjQ
--HG--
extra : rebase_source : 797b3be8f6adb027f15dd638f22afa6efd0f0432
The element click functions in testing/marionette/interaction.js are
generator functions using "yield". This patch converts them to async
functions.
MozReview-Commit-ID: 4A4cTaY619w
--HG--
extra : rebase_source : 1b6f1b545f438ae253fd4024500bf41536d976aa
Implements the backend for the WebDriver standard's Minimize Window
command.
Signed-off-by: Andreas Tolfsen <ato@sny.no>
MozReview-Commit-ID: F5Z38LxhOJm
--HG--
extra : rebase_source : 81c8d78ad8d9ae66a8ab37e635cce9af518224de
Various fixes to make the generated API documentation from
testing/marionette somewhat easier to read.
MozReview-Commit-ID: F9duuQoOYBt
--HG--
extra : rebase_source : 3ade69773ceba42826aedef05b1371240b51cf82
When linting the Marionette server code,
https://searchfox.org/mozilla-central/commit/de001d80b777ff0fcfa823a52e8d49b4981af040
accidentally removed the missing window check from the
Marionette:GetWindowRect command. This change reintroduces the
check that was accidentally removed.
MozReview-Commit-ID: FkDOUKR2dIi
--HG--
extra : rebase_source : abc32aec9b005f341d1e1deb1bbc9a3132dd35cb
baseURI isn't actually we have to check for to get the
current documents URI. Therefore documentURI exists.
MozReview-Commit-ID: CDhOZ8lU2qJ
--HG--
extra : rebase_source : c53f79468a7d319bd5e7aa40338fce0ca7299bd4
With multi-processes for content reloads of the frame script
can happen at any time, and not only for remoteness changes.
As such the current browser has to be re-registered with the
new id of the listener.
MozReview-Commit-ID: 48MOZfuPTR9
--HG--
extra : rebase_source : 60e91ae7e1cdc942d0ac9a9dd3aac3baeccc5ddf
This wrapper just calls back into the MarionetteDriver, and
doesn't have any value. Removing it simplifies the call stack.
MozReview-Commit-ID: GH1xUHX12Xi
--HG--
extra : rebase_source : a3b9e57e63809c9936fdb2686ad6016339ea7bf7
By not using the JSON format when sending the capabilities to the
frame script, the values cannot be correctly decoded. As result
the capabilities will be reset to their default values for the
listener, and can cause various failures.
MozReview-Commit-ID: KaryoJiyd30
--HG--
extra : rebase_source : 206e45755d3ea9b6cbf2f2022a9a364dcf22d78e
To retrieve the title of the currently selected content browser
it is not necessary to call into the frame script. Instead just
take the value from the parent process directly.
MozReview-Commit-ID: KEpYKLIydrJ
--HG--
extra : rebase_source : 8b179de7057f8655a81656bd4d95b1562edb9f54
getContext and setContext are duplicated further up under the Marionette
serivce entries.
MozReview-Commit-ID: 2V5S2XG6wDw
--HG--
extra : rebase_source : 1f22adc294c063f014e3a0e884a01ed6a7fbe43e
In particular, XPCNativeWrapper should probably be made available
by default.
MozReview-Commit-ID: E1oYFyApbLi
--HG--
extra : rebase_source : 4e27ad6882bd4e43dadc97d4fd2a186e01510dfd
Instead of importing everything from the testing/marionette/error.js
module into the global scope, we need to be selective about what symbols
we want.
MozReview-Commit-ID: HZDAS0bs0GD
--HG--
extra : rebase_source : 14a300bb2cedc0716168d50846755a6faed83012
The quitApplication command was accidentally removed in 1e96a289d28a.
This adds it back as a recognised command alias in order to not break
geckodriver.
MozReview-Commit-ID: IZ0h8dv9ILt
--HG--
extra : rebase_source : 61550dae3a71973a2028d6384bc3eab388c17c21
In some cases the click command can trigger the closing of the
currently selected tab or window. To not cause a hang when waiting
for a response from the removed framescript, the tab and window
closing events have to be observed. Also the command has to return
immediately.
MozReview-Commit-ID: 9WeXryrKEJr
--HG--
extra : rebase_source : a7a23cf19e55eecbf957d48c2182a601d63d0909
This adds commands to start a reftest session, run a test, and end the
session. It as assumed that after you start a reftest session you will
just run reftests until you end the session. When starting a session
the user provides a string indicating when screenshots should be
taken, and an object mapping urls to a count of the number of times
that url is expected to be used in the session, to help with
caching. Running the tests takes a url to a test, an expected status,
a timeout, and a nested list of possible references, in which each
entry at a specific level is combined by OR and nested references are
combined by AND.
The implementation is heavilly inspired by the existing reftest
harness, starting a minimal window with no tabs, and loading the urls
directly in there. In order to get a screenshot in the e10s case we
have to pass the DRAW_VIEW and USE_WIDGET_LAYERS flags when taking the
screenshot.
For performance we heavily cache canvases; for references that will be
repeated we cache the full canvas with image, and we also cache a
single canvas to use for all other screenshots to avoid the overhead
of repeatedly creating a new canvas element.
MozReview-Commit-ID: JOFvtmH7tg
Because this window is a normal Firefox window but doesn't contain any
tabs, the normal Marionette functions for iterating over windows don't
work well. As a sort of hack, identify this window by the id of its
root element, and special case it when finding windows in Marionette.
MozReview-Commit-ID: LxPv13YDXDu
This allows other commands to implicitly change the window handle, by
calling findWindow with appropriate arguments to get a window
properties object and then passing that to setWindowHandle.
MozReview-Commit-ID: 4NpYxjsMM4T
This adds commands to start a reftest session, run a test, and end the
session. It as assumed that after you start a reftest session you will
just run reftests until you end the session. When starting a session
the user provides a string indicating when screenshots should be
taken, and an object mapping urls to a count of the number of times
that url is expected to be used in the session, to help with
caching. Running the tests takes a url to a test, an expected status,
a timeout, and a nested list of possible references, in which each
entry at a specific level is combined by OR and nested references are
combined by AND.
The implementation is heavilly inspired by the existing reftest
harness, starting a minimal window with no tabs, and loading the urls
directly in there. In order to get a screenshot in the e10s case we
have to pass the DRAW_VIEW and USE_WIDGET_LAYERS flags when taking the
screenshot.
For performance we heavily cache canvases; for references that will be
repeated we cache the full canvas with image, and we also cache a
single canvas to use for all other screenshots to avoid the overhead
of repeatedly creating a new canvas element.
MozReview-Commit-ID: JOFvtmH7tg
--HG--
extra : rebase_source : ab5a2ef2e450b9bbdc6bc3c9487ed5dfda2c1d4b
Because this window is a normal Firefox window but doesn't contain any
tabs, the normal Marionette functions for iterating over windows don't
work well. As a sort of hack, identify this window by the id of its
root element, and special case it when finding windows in Marionette.
MozReview-Commit-ID: LxPv13YDXDu
--HG--
extra : rebase_source : 8c0aa7a4aeff69e1d7c86ba7cbb6c421abd0c31d
This allows other commands to implicitly change the window handle, by
calling findWindow with appropriate arguments to get a window
properties object and then passing that to setWindowHandle.
MozReview-Commit-ID: 4NpYxjsMM4T
--HG--
extra : rebase_source : 9b53d8b10e2341624c3add5e9975aab47e0b320f
In some cases the click command can trigger the closing of the
currently selected tab or window. To not cause a hang when waiting
for a response from the removed framescript, the tab and window
closing events have to be observed. Also the command has to return
immediately.
MozReview-Commit-ID: 9WeXryrKEJr
--HG--
extra : rebase_source : 682d67d51109c57a6de1a129492ebb5b635d7c56
The cookie service relies on the current document's
domain which is accessible from chrome space through
this.curBrowser.contentBrowser.contentURI.host.
As it is implemented currently, Marionette's cookie service jumps
between chrome- and content space more than necessary. This incurs
significant serialisation and IPC overhead, considering that the domain,
hostname, and current path information is readily available in chrome
space.
This patch removes all cookie-related functionality from
testing/marionette/listener.js, and implements a pure chrome-only
version of the service. It does, however, not try to fix conformance
issues with the WebDriver specification, of which there are many.
Some of the algorithms, especially to do with iteration over cookies,
implemented in cookie.iter, is also highly suboptimal. I have not
fundamentally changed any algorithms, and so my recommendation is to
address this later when addressing potential conformance bugs.
MozReview-Commit-ID: Fgs8ocbDJxb
--HG--
extra : rebase_source : 16470d5341459e40b1ceed12728451d517bbc490
Instead of returning a string representation of the current locaton from
GeckoDriver#currentURL, we encode it as a URL object.
browser.Context#currentURL is also renamed to currentURI to reflect that
it now returns an nsIURI object.
The motivation behind this change is that we need to access a URL's port,
protocol, pathname, and hostname separately.
MozReview-Commit-ID: DM7gkrHhFpb
--HG--
extra : rebase_source : 1c8c3535bebc1e91a7f8ddaa88278cc78f66cf56