The preference prompts.tab_modal.enabled doesn't need a restart of Firefox. It
means there is no need to use enforce_gecko_prefs() for the tests.
MozReview-Commit-ID: 4tPBPV5v7X4
--HG--
extra : rebase_source : c9fe78f778441c66794635ebb2fdc5b8ac88c7cc
The target node of HTMLEditRules::ReapplyCachedStyles() may be styled with its parent. When HTMLEditRules::ReapplyCachedStyles() is called, it shouldn't restore another style cache if it's already specified in current DOM tree.
MozReview-Commit-ID: DKCpQ8YyW7
--HG--
extra : rebase_source : 854b4cc6382f5357919bce1e106e71fe66b15444
Capabilities are sent to the content frame script as a JSON blob.
We can re-parse that in the listener to make use of the same complex
object representation there.
Because the listener is comprised of a set of top-level functions and
not an object prototype, we cannot reuse the same pointer/getter trick
as in testing/marionette/driver.js. However, we can change this later
when we do introduce more robust code organisation to this file.
MozReview-Commit-ID: 7PpholLqtF
--HG--
extra : rebase_source : 93b94678ac2184255b1c708103eb5cf44f9d2266
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
This patch provides a (nearly) WebDriver conforming implementation
of capabilities in Marionette. The work remaining is pending further
clarification in the specification.
Capabilities are represented internally as a complex object provided
by `session.Capabilities`. Timeouts and proxy configuration are also
represented by the similar complex objects `session.Timeouts` and
`session.Proxy`, respectively.
The capabilities stored in `GeckoDriver#sessionCapabilities` are the
result of parsing user-provided desired- and required capabilities.
WebDriver now uses `firstMatch` and `alwaysMatch` primitives for
capabilities, but as this is considered a wider breaking change, the
move to these primitives will be done at a later stage. It’s prudent
to point out that the base techniques used with the new primitives
are similar to those implemented for `desiredCapabilities` and
`requiredCapabilities` in this patch, and that the work needed to adapt
them is considered trivial.
When capabilities are presented back to the user (the so called processed
capabilities), we call the `toJSON` implementation on the complex objects.
`session.Capabilities#toJSON` calls the internal function `marshal`
which ensures empty fields are dropped. `marshal` can be considered to
be a specialisation of the standard library `JSON.stringify`, which also
calls `toJSON` on entry values if they provide this function.
The changeset overall also provides a much deeper level of testing of
WebDriver capabilities.
MozReview-Commit-ID: 97xGt3cnMys
--HG--
extra : rebase_source : 98e0bde3fdfd811775d195b488cb1255f61e5772
Capabilities should be sent in either a `desiredCapabilities` or a
`requiredCapabilities` block inside `capabilities`:
{capabilities: {requiredCapabilities: {acceptInsecureCerts: true}}}
Marionette currently accepts capabilities in the top-level dictionary,
but this is not conforming to the WebDriver.
MozReview-Commit-ID: 9JWjvPKBp6S
--HG--
extra : rebase_source : 88a12dcba275d6eedc5640bd3a0033b6dbd1d86d
When we currently create new WebDriver errors we throw away the stacktrace
generated by `WebDriverError`'s prototype, `Error`. This change stores
the stacktrace, which will cause it to be serialised and returned to
the client.
This change is not as valuable as storing the stacktraces of internal
errors, but brings symmetry to our error handling and may be useful if
only to navigate to the source of an error.
MozReview-Commit-ID: LCFMwKxxcTp
--HG--
extra : rebase_source : 56947805f29000a64c2daef0fd774ea90330c09e
The implementation of the new library function `assert.in` is analogous
to Python's `unittest.TestCase.assertIn`.
MozReview-Commit-ID: 1pjS9ttPXgo
--HG--
extra : rebase_source : 3f4121226d65f127fdf0c990915483659f3a7f93
The `stack` argument to `WebDriverError` has never been in use. Following
the API of the `Error` prototype, this changes its constructor to take
one argument which can either be a string of an `Error`.
When internal errors are thrown in Marionette, they are usually
wrapped in `WebDriverError` but we currently lose track of its stack.
This preserves the wrapped error's stacktrace by setting the `stack`
property. Practice have found that they are very useful to return to
the client, as they are currently only printed to stdout.
MozReview-Commit-ID: 9sTdP4TntIc
--HG--
extra : rebase_source : f14197a1c8700215ce3d0edc7078c9f568b80ec4
Calling `typeof` on arrays or null in JavaScript returns `"object"`,
and a safer check is to rely on `Object.prototype.toString`.
MozReview-Commit-ID: 5VxXf2ByoEx
--HG--
extra : rebase_source : 4d1fe95a75343964836e670d0ceffa6ce680e390
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
Flipping the preference "dom.webcomponents.enabled" doesn't require a restart.
As such there is no need to use enforce_gecko_prefs().
MozReview-Commit-ID: 6sl1xycwWII
--HG--
extra : rebase_source : 6444825d3addf6a71f1cb495c1dfb79b0fa7c1d4
This allows the |e10s| argument in BaseMarionetteTestRunner to enable e10s in
the browser without depending on |BaseMarionetteArguments.verify_usage|.
Unlike other args like |jsdebugger|, the |e10s| argument is found in both
BaseMarionetteArguments and BaseMarionetteTestArguments, so it's more
intuitive to pass it along and perform all the associated setup
in BaseMarionetteTestRunner.
MozReview-Commit-ID: JCvxdazjq8p
--HG--
extra : rebase_source : 9a89733e9ba0ffce9060f01bd04115b796ff8b08
Previously, this log message was based on self.e10s, which only reflects the
option passed into Marionette runner, not what is actually happening in the browser.
MozReview-Commit-ID: GY2AaBKBA1h
--HG--
extra : rebase_source : 735ca90efdc86b3cc5f6ce81e81845009acfbbd2
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
browser.Context has an awful API and this is a small step in the direction
of mitigating some common misconceptions about its internal state.
MozReview-Commit-ID: Bl5197GiSEL
--HG--
extra : rebase_source : 8dfb5a38e51eaa0721053d9f77d15429ccd94051
This fixes the case where the call to runner.run_tests() raises
an exception before any tests start, thus leaving a
browser instance running.
MozReview-Commit-ID: LFcCZcJJsgf
--HG--
extra : rebase_source : 99a55b534a5260cb791d9dca24364592d24d5d72
Dumping symbols can interfere with staging cppunittests in case calling
objcopy from the symbol dumping script coincides exactly with calling
objcopy when staging cppunittests when the two are run in parallel. This
makes dumping symbols depend on staging cppunittests.
MozReview-Commit-ID: Hgi1zyIZE7K
--HG--
extra : rebase_source : 1afda6854cd1ff0a651cd9fa1bde17fc0c797b01