So far Marionette did support Fennec but not any of its tab handling
features. As such most of the commands fail because they do not take
BrowserApp into account.
This patch adds support for retrieving window handles, switching
between windows, and closing tabs.
Additionally to those changes a couple of unit tests are getting
updated, and added.
MozReview-Commit-ID: 7sbVIblm0Hw
--HG--
rename : testing/marionette/harness/marionette_harness/tests/unit/test_window_handles.py => testing/marionette/harness/marionette_harness/tests/unit/test_window_handles_content.py
extra : rebase_source : 34bfcd680162d4296d524f72f7d6190ef64682b8
So far Marionette did support Fennec but not any of its tab handling
features. As such most of the commands fail because they do not take
BrowserApp into account.
This patch adds support for retrieving window handles, switching
between windows, and closing tabs.
Additionally to those changes a couple of unit tests are getting
updated, and added.
MozReview-Commit-ID: 7sbVIblm0Hw
--HG--
rename : testing/marionette/harness/marionette_harness/tests/unit/test_window_handles.py => testing/marionette/harness/marionette_harness/tests/unit/test_window_handles_content.py
extra : rebase_source : 475dd6bee446f58208192202cd4c483e2fd929dc
To avoid a race condition for the close() commands Marionette has to wait until the current
window/tab has actually been closed. To make this work we have to wait for the appropriate
events to occur. Also the methods have to return the list of remaining window handles.
MozReview-Commit-ID: DegcTJyKXCx
--HG--
extra : rebase_source : a6bd46d2d721f56fcc07a0722f2155ea29dc6fbc
This change resets the session ID after all other state has been cleared,
and also reinitialises `GeckoDriver#sessionCapabilities`, which was not
done before.
MozReview-Commit-ID: Jb40CXuX8h1
--HG--
extra : rebase_source : 226875ea929f0e7e471fe58499f76313fc60947e
This change removes session capability processing
from testing/marionette/driver.js and replaces it with
testing/marionette/session.js and `session.Capabilities`.
Session timeout durations used to be stored in properties
exposed directly on the `GeckoDriver` prototype, but these are now
represented by `GeckoDriver#timeouts`, which is a pointer (getter) of
`GeckoDriver#sessionCapabilities#timeouts`. The same is true for other
session-scoped state.
Since capabilities parsing is not unique to starting a new session,
the errors thrown by `session.Capabilities.fromJSON` are re-thrown
in `GeckoDriver#newSession` since it is required that we return a
`SessionNotCreatedError` on parsing them during session creation.
MozReview-Commit-ID: I3Xu2v71n4S
--HG--
extra : rebase_source : 40cef31adf238bef021a7c7c2713016a34f35920
Unit tests which do a restart/quit of the application should not be run if Marionette
doesn't handle the instance. Otherwise Marionette is not able to launch the application
again for further tests.
MozReview-Commit-ID: 8mKylM0r4dM
--HG--
extra : rebase_source : 8d1853c376fe36c4f779b3d417edb2dbb829a1a3
When a new Marionette session is started, the web content frame (currently
selected <xul:browser> element) is not in focus, causing issues such
as https://github.com/mozilla/geckodriver/issues/394.
This changes the current web content to be selected upon top-level
browsing context navigation and the creation of new sessions.
MozReview-Commit-ID: EgG9gRHtwOA
--HG--
extra : rebase_source : 79c89e2a6d35badf454645bbfb5197a94bb1f980
Commands which are not (yet) supported in chrome context have to throw an
UnsupportedOperationError to indicate that they cannot be used instead of
silently eating failures.
MozReview-Commit-ID: 2eFYAfKaQpD
--HG--
extra : rebase_source : e84c0cde92075a1a5fd91b7e75f0e8c1cace00fa
By the webdriver spec the code has to fail with a NoSuchWindowError if the
active window is no longer present.
MozReview-Commit-ID: HFl7yO5ErRn
--HG--
extra : rebase_source : d170e400c1624e680745e7023041413055ef9bd0
The screenshot code in chrome scope is updated to use the generic capture module,
which is already used for content scope. By that change the code which captures
the canvas makes use of devicePixelRatio now. It means the screenshot will be
scaled depending on the screen configuration, eg. on Andoid this mostly 2.
MozReview-Commit-ID: EBKmJEKVXPQ
--HG--
extra : rebase_source : cd399eb3ee012516b218b9d1a5fd26422ebc9be0
Formerly getElementAttribute() has returned a mix of attributes and
properties. Since getElementProperty() has been added, there is no
need anymore for getElementAttribute() to return conflated data.
MozReview-Commit-ID: 29saWd9PsOX
--HG--
extra : rebase_source : e1dece7586c9b22320db406cfd60d211195f5f18
This change renames the `raisesAccessibilityExceptions` capability to
`moz:accessibilityChecks` to conform with the format of extension
capabilities as defined in the WebDriver specification.
As this feature is not tested or used in the Firefox upgrade tests and
has limited deployment outside Mozilla, it is considered safe for this
to be a breaking change.
MozReview-Commit-ID: DRA16cWJDX0
--HG--
extra : rebase_source : 42fac27f655ce431ae68bbaeeec6a208d91e9033
The payload sent to the listener through `GeckoDriver#sendAsync` is
sometimes mutated if a `commandID` parameter is given. Because `data`
is sometimes a reference to an object, the original object gets modified
with an additional `command_id` field.
To avoid this we copy the object before mutating it and pass it through
to the message manager.
MozReview-Commit-ID: HM2tnPqbAge
--HG--
extra : rebase_source : 6aa593973d82bdf4addd8003ce68df9ad3179a4a
By the webdriver spec the code has to fail with a NoSuchWindowError if the
active window is no longer present.
MozReview-Commit-ID: HFl7yO5ErRn
--HG--
extra : rebase_source : 8d8271751a4cffdf4e74d4e66ff71588e7d2a01e
The screenshot code in chrome scope is updated to use the generic capture module,
which is already used for content scope. By that change the code which captures
the canvas makes use of devicePixelRatio now. It means the screenshot will be
scaled depending on the screen configuration, eg. on Andoid this mostly 2.
MozReview-Commit-ID: EBKmJEKVXPQ
--HG--
extra : rebase_source : 3d177eeac4935660f43727a20445a39fe78a2c45
Formerly getElementAttribute() has returned a mix of attributes and
properties. Since getElementProperty() has been added, there is no
need anymore for getElementAttribute() to return conflated data.
MozReview-Commit-ID: 29saWd9PsOX
--HG--
extra : rebase_source : c98ba2bd30afbd794198e5cc9697f5d2e7050317
This introduces a new capability, `moz:profile`, which contains the path
to the currently used profile directory.
MozReview-Commit-ID: FKF4Hde3tF9
--HG--
extra : rebase_source : 207fce0eec9c74eb4d1218f0f088e6a05ae7a7ba
The WebDriver specification says that any proprietary capabilities
should be defined as so called extension capabilities, which means we
must prefix them with `moz:`.
Even though the `processId` capability is removed, this change is
backwards compatible because a new property `Marionette.process_id`
is introduced that looks for `moz:processID` and `processId` in order
when starting a new session.
MozReview-Commit-ID: ChkC6QTklzC
--HG--
extra : rebase_source : cffa52b1e6407edaf91bb21afebaa441a208f705
When the `acceptInsecureCerts` capability is set to true on creating
a new Marionette session, a `nsICertOverrideService` override service
is installed that causes all invalid TLS certificates to be ignored.
This is in line with the expectations of the WebDriver specification.
It is worth noting that this is a potential security risk and that this
feature is only available in Gecko when the Marionette server is enabled.
MozReview-Commit-ID: BXrQw17TgDy
--HG--
extra : rebase_source : 023f18b07ffbb53c7dbc588a823c62830f032e3d
When arriving at a document which baseURI starts with `about:certerror`
will cause Marionette to now return `error.InsecureCertificateError`.
This is mandated by the WebDriver specification.
This does, however, mark a non-backwards compatible change in Marionette.
It is assumed we will be able to mitigate this change in error type as
few consumers, if any, rely on the more generic type considering we did
not support invalid TLS certificates prior to this push.
MozReview-Commit-ID: JcIMvCXimB
--HG--
extra : rebase_source : 5e2dffe8e5d16ae3fe407ed42c43d52b49e3741d
`acceptSslCerts` has been replaced by `acceptInsecureCerts`.
MozReview-Commit-ID: 79KbRoQb1dW
--HG--
extra : rebase_source : 1c0e4fcb468d5c196351cb21715804c98b5fef02
Reads the `acceptInsecureCerts` capability and sets the session state.
MozReview-Commit-ID: KVErmdxwXQB
--HG--
extra : rebase_source : 50ce229909cfc9a407fdadc593b57a9545342723