Since bug 1326534 we have discarded the original stacktrace from errors
originating inside Marionette. This was due to faulty logic when
attempting to generate a new stacktrace when it was missing from a
propagated error.
This change simplifies WebDriver errors by making use of Error
inheritance. The WebDriver error specific functions error.toJson and
error.fromJson has additionally been moved to WebDriverError.
MozReview-Commit-ID: C3Ns0H01LyG
--HG--
extra : rebase_source : 0c705054dae8c0647500bb90e9b970cc57e712c4
In order to achieve WebDriver parity, Marionette needs the ability to
evaluate scripts in content space with lasting side-effects. This means
that state modifications should affect behaviour and state of the browsing
context, and such transgress the boundaries of the sandbox.
This patch brings a new script evaluation module that is shared between
code in chrome- and content space. This brings the number of unique
script evaluation implementations in Marionette down from six to one.
evaluate.sandbox provides the main entry-point for execution. It is
compatible with existing Marionette uses of Execute Script and Execute
Async Script commands in Mozilla clients, but also provides a new stateful
sandbox for evaluation that should have lasting side-effects.
It is not expected that Mozilla clients, such as testing/marionette/client
and the Node.js client in Gaia, should have to change as a consequence
of this change.
A substantial change to the script's runtime environment is that many
globals that previously existed are now only exposed whenever needed.
This means for example that Simple Test harness functionality (waitFor,
ok, isnot, is, &c.) is only available when using a sandbox augmented
with a Simple Test harness adapter.
Conversely, this patch does not expose marionetteScriptFinished as a
callback to asynchronous scripts for sandboxes which sandboxName parameter
is undefined, because this is what determines if the script should be
evaluated under WebDriver conformance constraints. In all other cases
where sandboxName _is_ defined, the traditional marionetteScriptFinished
et al. runtime environment is preserved.
MozReview-Commit-ID: 8FZ6rNVImuC
In order to achieve WebDriver parity, Marionette needs the ability to
evaluate scripts in content space with lasting side-effects. This means
that state modifications should affect behaviour and state of the browsing
context, and such transgress the boundaries of the sandbox.
This patch brings a new script evaluation module that is shared between
code in chrome- and content space. This brings the number of unique
script evaluation implementations in Marionette down from six to one.
evaluate.sandbox provides the main entry-point for execution. It is
compatible with existing Marionette uses of Execute Script and Execute
Async Script commands in Mozilla clients, but also provides a new stateful
sandbox for evaluation that should have lasting side-effects.
It is not expected that Mozilla clients, such as testing/marionette/client
and the Node.js client in Gaia, should have to change as a consequence
of this change.
A substantial change to the script's runtime environment is that many
globals that previously existed are now only exposed whenever needed.
This means for example that Simple Test harness functionality (waitFor,
ok, isnot, is, &c.) is only available when using a sandbox augmented
with a Simple Test harness adapter.
Conversely, this patch does not expose marionetteScriptFinished as a
callback to asynchronous scripts for sandboxes which sandboxName parameter
is undefined, because this is what determines if the script should be
evaluated under WebDriver conformance constraints. In all other cases
where sandboxName _is_ defined, the traditional marionetteScriptFinished
et al. runtime environment is preserved.
MozReview-Commit-ID: 8FZ6rNVImuC
--HG--
extra : rebase_source : 38cc7b1e374fd42afb213133fd1a5e11bf8bdd95
error.wrap acts as a no-op if it is passed a prototype which is already
of the WebDriverError prototypal chain.
MozReview-Commit-ID: Gd9kUEvsgNv
--HG--
extra : histedit_source : a6e620e3e4b6bfa4e1d77df48eaab59ffbc3cdce
extra : rebase_source : a94ae7fff63530a4cc4d1875bb4894657834ecb0
extra : commitid : HObqpKV7a9s
extra : source : d75ad1397656e43d22d0d69211df9fce3a667f0d
extra : intermediate-source : eff85dc0eaa9da4c4dff306cdb9a7474df29ccf1
error.wrap acts as a no-op if it is passed a prototype which is already
of the WebDriverError prototypal chain.
MozReview-Commit-ID: Gd9kUEvsgNv
--HG--
extra : commitid : HObqpKV7a9s
extra : rebase_source : c96b3c1a00a68a56d69d253945de5607039e3b49
extra : source : d75ad1397656e43d22d0d69211df9fce3a667f0d
extra : histedit_source : a6e620e3e4b6bfa4e1d77df48eaab59ffbc3cdce
error.wrap acts as a no-op if it is passed a prototype which is already
of the WebDriverError prototypal chain.
--HG--
extra : commitid : HObqpKV7a9s
extra : rebase_source : 04b8d3d9f1ebb563b2258231e3d34f9c1c2883ae
extra : histedit_source : a6e620e3e4b6bfa4e1d77df48eaab59ffbc3cdce
This fixes an instance of passing an Error prototype over the message
manager as a CPOW. We solve this by marshaling the error, which is
now done automatically by the new AsyncMessageChannel. It allows us to
create an (almost) transparent promise-based interface between chrome-
and content contexts.
The patch also makes AsyncMessageChannel reusable on both sides of the
message listener, but it's currently not used at its maximum potential
because of the way the listener is architected.
--HG--
extra : commitid : EQd5E4Digdv
extra : rebase_source : 8e0c36960759d25c73bbbc0f4f0bcb453c1028f4
extra : amend_source : 6bb6a76a8b30a5524639f8236291980b16402e6a
This change reduces the number of content frame script message senders
from three to one by imposing a message format.
--HG--
extra : rebase_source : 2e2940eb7d095e22a60d3e6f3af44446bb425c93
Moves most of the cookie implementation to a new file,
testing/marionette/cookies.js. The new Cookies class encapsulates all
APIs for manipulating and querying cookies from content space.
It communicates with chrome space, where the cookie manager lives, through
a new SyncContentSender provided by testing/marionette/proxy.js. This new
interface provides synchronous and transparent communication from content
to chrome, not dissimilar from how the original listener proxy works.
r=dburns
--HG--
extra : commitid : 7jF7OFSx4Yk
extra : rebase_source : 8fc73fb59196f8076e85673d002c42e2ae458ad0
The Python client does not currently exhaust all the command
requests originating from the server as pointed out by :bhsu in
https://bugzilla.mozilla.org/show_bug.cgi?id=1211503#c12.
This prevents making multiple calls to runEmulatorCmd and runEmulatorShell
inside executeScript/executeJSScript/executeAsyncScript. This failure
makes marionette-webapi fail.
We loop through all the commands originating from the server until we
get sent back a response.
r=dburns
--HG--
extra : commitid : 1SVHwcJrDcU
The Python client does not currently exhaust all the command
requests originating from the server as pointed out by :bhsu in
https://bugzilla.mozilla.org/show_bug.cgi?id=1211503#c12.
This prevents making multiple calls to runEmulatorCmd and runEmulatorShell
inside executeScript/executeJSScript/executeAsyncScript. This failure
makes marionette-webapi fail.
We loop through all the commands originating from the server until we
get sent back a response.
r=dburns
--HG--
extra : commitid : 8oBRRddi4TJ
extra : rebase_source : 98b10ccaba525acd391bf614a91aec1b8f7daf4e