Граф коммитов

307 Коммитов

Автор SHA1 Сообщение Дата
Andreas Tolfsen 46053b96d4 Bug 1470646 - Modularise capabilities module. r=whimboo
This removes the "session." prefixed global export type in favour
of individually exported types.

MozReview-Commit-ID: 3DHTrJsy2IN

--HG--
extra : rebase_source : 74674f2cc549a245472304c55a14dd2eca1ee235
2018-06-26 17:15:28 +01:00
Coroiu Cristina cc751350dc Backed out 8 changesets (bug 1470646) for linting failure on a CLOSED TREE
Backed out changeset 9b8d9f803b25 (bug 1470646)
Backed out changeset 58e2010d2842 (bug 1470646)
Backed out changeset 2b19429d778f (bug 1470646)
Backed out changeset e543f592454a (bug 1470646)
Backed out changeset 22469044267d (bug 1470646)
Backed out changeset e5415b1e22f5 (bug 1470646)
Backed out changeset 13e47fa99a31 (bug 1470646)
Backed out changeset 42964d651f02 (bug 1470646)

--HG--
rename : testing/marionette/capabilities.js => testing/marionette/session.js
rename : testing/marionette/test/unit/test_capabilities.js => testing/marionette/test/unit/test_session.js
2018-07-02 17:56:27 +03:00
Andreas Tolfsen a355154c28 Bug 1470646 - Modularise capabilities module. r=whimboo
This removes the "session." prefixed global export type in favour
of individually exported types.

MozReview-Commit-ID: 3DHTrJsy2IN

--HG--
extra : rebase_source : eb2c05c1970c67b5752ece4b916145f053109f69
2018-06-26 17:15:28 +01:00
Andreas Tolfsen 64a77308d6 Bug 1464469 - Prefix frame script logs with the outerWindowID. r=whimboo
This change will prefix all log entries originating from a frame
script with the content browser's outerWindowID.  That makes it
easier to for example keep of the origin of web DOM event logging.

Whilst it is true that Marionette operates in one browser context at a
time, the frequent context switches make it a cognitive challenge to
keep track of which browser is currently active.  This is especially
true at the moment when Marionette does not have the capability to
uniquely identify a browser.

The intention is to change from using the outerWindowID,
which changes when a content browser undergoes a remoteness
change, to using a unique identifier for the browser once
https://bugzil.la/marionette-window-tracking is available.

MozReview-Commit-ID: 813zALY3I9i

--HG--
extra : rebase_source : 559ca853befb2da4a255d59b9525dece962fa357
2018-06-06 14:45:46 +01:00
Andreas Tolfsen 13565e21f4 Bug 1468026 - Rename MarionetteMainProcess to MarionetteParentProcess. r=whimboo
The "parent process" terminology is already established in the
parent process message manager.  This aligns the Marionette component
with this terminology.

MozReview-Commit-ID: 12z1M5jAWDa

--HG--
extra : rebase_source : e735dd5a15c39703cad9799dd7578fed5fb1f139
2018-06-09 18:57:03 +01:00
Andreas Tolfsen 0be64b42c5 Bug 1467744 - Lazily import globals in Marionette. r=whimboo
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
2018-06-08 13:16:29 +01:00
David Burns 27aec1d009 Bug 1387678 - Check if element is passed in is actually an element; r=ato
When we traverse up a shadow DOM we pass in null as an indicator to
move upwards. We now check that it is really an element and if not
assume that it is null and move up the tree

MozReview-Commit-ID: AK9eOLFDAgB

--HG--
extra : rebase_source : c748d0fd22d29286f40b78b8790f4a339dfd4299
2018-05-09 09:19:28 +01:00
David Burns 70e11aedc2 Bug 1387678 - Correct import of pprint in Marionette listener; r=ato
MozReview-Commit-ID: Jik6n0CDYk2

--HG--
extra : rebase_source : bffb592c050f4d6309dc1070ac16aad7e4fff5bb
2018-05-09 09:16:19 +01:00
Andreas Tolfsen 58db281570 Bug 1463085 - Remove unnecessary self-assignment. r=maja_zf
Prior to bug 1400256 we used to have to deserialise the web
element received from chrome space manually, and presumably this
self-assignment is a leftover from that time.

This fixes an eslint error upon upgrading to eslint version 5.

Thanks-to: Mark Banner <standard8@mozilla.com>
MozReview-Commit-ID: A46wK71AwBe

--HG--
extra : rebase_source : 2ad04f87b31cb369c7c3acf6a50a3bcbd493a735
2018-05-21 13:29:30 +01:00
Andreas Tolfsen c65aa9b433 Bug 1460656 - Fix sync IPC message Marionette:GetLogLevel by using initialProcessData. r=maja_zf
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
2018-05-10 17:32:42 +01:00
Andreas Tolfsen e8b0dd1386 Bug 1442543 - Add type checks for WebDriver:{ExecuteScript,ExecuteAsyncScript}. r=whimboo
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
2018-03-02 13:25:59 +00:00
Jared Wein 9788800512 Bug 1436575 - Manually fix the errors from no-compare-against-boolean-literal that the autofix couldn't change. r=standard8
MozReview-Commit-ID: 6NtfU76sPKv

--HG--
extra : rebase_source : 143891b98995658a5683e01631eba9f6a2bb7b6f
2018-02-08 13:35:53 -05:00
Henrik Skupin 63313b65f6 Bug 1429338 - Marionette has to honor "moz:useNonSpecCompliantPointerOrigin" capability. r=maja_zf
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
2018-01-23 17:31:06 +01:00
Andrew McCreight 5dec0e0beb Bug 1432992, part 1 - Remove definitions of Ci, Cr, Cc, and Cu. r=florian
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
2018-02-06 09:36:57 -08:00
Kris Maglione 918ed6c474 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
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
2018-01-29 15:20:18 -08:00
Cosmin Sabou 9a65a40178 Backed out 3 changesets (bug 1431533) for Android mochitest failures on testEventDispatcher on a CLOSED TREE
Backed out changeset a1eca62826a1 (bug 1431533)
Backed out changeset 34c999fa006b (bug 1431533)
Backed out changeset e2674287e57f (bug 1431533)
2018-01-30 07:17:48 +02:00
Kris Maglione 6476f95b13 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
2018-01-29 15:20:18 -08:00
Brindusan Cristian af8879d1eb Backed out 2 changesets (bug 1431533) for ESlint failures on a CLOSED TREE
Backed out changeset 6e56f4c8843e (bug 1431533)
Backed out changeset 12fc4dee861c (bug 1431533)
2018-01-30 02:32:43 +02:00
Kris Maglione c276bb9375 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : rebase_source : c004a023389f1f6bf3d2f3efe93c13d423b23ccd
2018-01-29 15:20:18 -08:00
Maja Frydrychowicz c5e2a01a54 Bug 1432773 - listen for unload in capture phase to reset click count; r=whimboo
The bubbling phase is too late so resetClick didn't always get called.

MozReview-Commit-ID: JIseY5o3oAX

--HG--
extra : rebase_source : c8d4c3748158f246261ff87e5684ada74682c241
2018-01-24 15:03:53 -05:00
Maja Frydrychowicz 7a30f6c6a4 Bug 1421878 - Reset Marionette's click state on document unload; r=whimboo
This makes more sense with the UIEvent spec and it should fix
intermittent failures caused by extra dblclick events that arise
from different tests polluting each other's state.

For the wdspec actions tests, the `test_actions_page`
fixture is function-scoped, so the page is reloaded between
each subtest.

MozReview-Commit-ID: HxPbMzYeXIV

--HG--
extra : rebase_source : d1e5da2b2e53475beab513c2159a990a17a373cf
2018-01-18 15:41:23 -05:00
Andreas Tolfsen 43af21554f Bug 1431089 - Truncate logged URLs. r=maja_zf
Because we use a lot of data URIs when testing Marionette, the URLs
we log during navigation can be quite long.  As with logged packets,
we should truncate the URLs.

MozReview-Commit-ID: AKpr5vvdU8P

--HG--
extra : rebase_source : 12d367901f96fe972a1b38ca76b7b46c1a8e47d3
2018-01-17 14:29:36 +00:00
Andreas Tolfsen 681ae6c180 Bug 1430077 - Separate clearing session state from deregistering listeners. r=whimboo
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
2018-01-12 13:30:23 +00:00
Andreas Tolfsen b70e3acf47 Bug 1430077 - Correct safety checks on Marionette:Register reply. r=whimboo
sendSyncMessage returns an array of replies from the frame message
manager, each item being the return value from each message listener
that handles the message.

In testing/marionette/driver.js there are two handlers for
Marionette:Register, but it is not predictable at the moment when
both or either one of them is triggered.  We would, however, always
expect a response, which means the reply array should never be empty.

MozReview-Commit-ID: 5F8YfKO8jBU

--HG--
extra : rebase_source : c23900fed32a52d228c91cb6428be569fb967f41
2018-01-12 13:28:28 +00:00
Andreas Tolfsen 4103c22b8c Bug 1430077 - Remove global outerWindowID in frame script. r=whimboo
outerWindowID is no longer used for adding message listeners,
which means we do not need to store it globally.

MozReview-Commit-ID: HZ0oY7ozwnu

--HG--
extra : rebase_source : 4a03927b5bdbe3d34a45faf8fa9646e0a58bd96a
2018-01-12 13:25:42 +00:00
Andreas Tolfsen a2f89134da Bug 1354211 - Make WebDriver:ElementClear conforming to standard. r=automatedtester
This implements the remote end steps for the Element Clear command
from WebDriver in Marionette.

The WPT test webdriver/tests/interaction/element_clear.py was deleted
because it tested a previous definition of the Element Clear command
and many of its tests were either incorrect or replaced by the new tests.

MozReview-Commit-ID: C2xmIlhSAdW

--HG--
extra : rebase_source : 8eddcee78450a8c7d10cf9f648bb1baabdac4ff1
2017-12-31 14:53:42 +00:00
Andreas Tolfsen a48dd7b64b Bug 1429091 - Use global message manager in AsyncMessageChannel. r=maja_zf
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
2018-01-09 15:53:46 +00:00
Andreas Tolfsen cf4259bb3d Bug 1426154 - Refactor Marionette content frame script registration. r=automatedtester
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
2018-01-09 19:50:30 +00:00
Andreas Tolfsen 480ee1d6e7 Bug 1426154 - Sort message listeners lexicographically. r=automatedtester
It is easier to review what message listeners are added and removed
when the list is sorted.

MozReview-Commit-ID: 2fMpulA42Ww

--HG--
extra : rebase_source : 64e80f7c314596f27400657bd2e77da110f1443e
2018-01-09 19:48:14 +00:00
Andreas Tolfsen 7eb64afd98 Bug 1426154 - Use targetted IPC messages to talk to content frames. r=automatedtester
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
2018-01-09 17:48:57 +00:00
Andreas Tolfsen 5fe12f3b2d Bug 1379490 - Query capabilities configuration from chrome. r=automatedtester
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
2018-01-02 12:00:41 +00:00
Andreas Tolfsen 3bf8512e70 Bug 1423282 - Drop Marionette:emitTouchEvent IPC message and related infra. r=automatedtester,maja_zf
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
2017-12-05 21:08:48 +00:00
Andreas Tolfsen 774177521d Bug 1423282 - Drop MarionetteFrame:getCurrentFrameId IPC message. r=automatedtester,maja_zf
The MarionetteFrame:getCurrentFrameId IPC message was used for B2G
applications that needed access to chrome-scoped APIs for emitting
touch events.  Now that actions happen either in chrome _or_ in
content this is no longer necessary functionality to maintain.

MozReview-Commit-ID: Bk9LRAOxjAw

--HG--
extra : rebase_source : 71dac090db681a24dc5ebb54fdf1cf02a97563b0
2017-12-05 19:40:29 +00:00
Andreas Tolfsen f42cdc3940 Bug 1423282 - Drop MarionetteFrame:getInterruptedState IPC message. r=automatedtester,maja_zf
MarionetteFrame:getInterruptedState was used in B2G to abortence
if the OOP frame got interrupted by a modal dialogue.  Like the
MarionetteFrame:handleModal IPC message, the frame script needed
chrome assistance for querying the presence of this dialogue.

Today modal dialogues (known as "user prompts") are handled entirely
in chrome space, and the presence of such a dialogue is indeed
meant to pause script execution in the web document.

This patch makes some rather questionable changes to the legacyaction
module, but this is alright because we don't expect any more tests to
be written using it.  This patch just about makes sure the remaining
body of tests keeps passing.

MozReview-Commit-ID: 72g0GlYy21T

--HG--
extra : rebase_source : f44ed5999554a42c67827d6935bd96cc79a8e5dd
2017-12-05 19:22:53 +00:00
Andreas Tolfsen f1282f9d51 Bug 1423282 - Drop Marionette:switchToModalOrigin IPC message. r=automatedtester
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
2017-12-05 18:44:24 +00:00
Andreas Tolfsen 68c9c60264 Bug 1423209 - Drop ability to put frame script to sleep. r=automatedtester
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
2017-12-05 17:07:36 +00:00
Henrik Skupin cb6d8c72b5 Bug 1414322 - Use WebDriver conformant interactability checks for sendKeysToElement. r=ato
Enables webdriver spec keyboard interactability tests for 'Element Send Keys'
by default by re-using the same capability 'moz:webdriverClick' from
'Element Click'. It can be disabled by turning off this preference.

Also various webplatform tests for webdriver spec have been added which
cover both the scroll into view action, and keyboard interactability check.

Existing Marionette unit tests will be run in both modes, until we can
get rid of the legacy mode.

MozReview-Commit-ID: dFB8sQ6CN5

--HG--
extra : rebase_source : 9f6a3c3e42f779f039f61d0b239f9f5925ecdcf5
2017-11-10 20:29:04 +01:00
Henrik Skupin 88c43fb94d Bug 1414322 - Refactor sendKeysToElement methods. r=ato
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
2017-11-09 20:39:51 +01:00
Andreas Tolfsen 0cde42dcd0 Bug 1106913 - Send errors from sendResponse/sendError back to chrome. r=whimboo
Errors that arise from inside sendResponse or sendError are currently
only logged to stdout.  Now that we have a pretty safe error.wrap
implementation we should serialise them and return them to the main
process so that they are not "lost" in stdout.

MozReview-Commit-ID: FuMeUqQ7CMv

--HG--
extra : rebase_source : 2d43eb63ec13dbfb461d72dd9ddee232ff4ff9d8
2017-11-24 18:19:18 +00:00
muthuraj90ec@gmail.com 502bc1193d Bug 1385476 - Synthesize dblclick MouseEvent when performing webdriver actions; r=maja_zf
MozReview-Commit-ID: 9u2mtolhjUq

--HG--
extra : rebase_source : 76b2e3fbd3cbb86f062227c779e88e61fefc1d8d
2017-11-24 15:53:57 -05:00
Andreas Tolfsen 4a2fe54072 Bug 1420431 - Return no such element error when on no active element. r=maja_zf
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
2017-11-24 16:23:02 +00:00
Andreas Tolfsen 0d995bbca5 Bug 1384956 - Get log level from main process when script is reloaded. r=whimboo
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
2017-11-11 17:43:24 -08:00
Henrik Skupin 20ad958852 Bug 1411393 - Marionette should not register listeners on the global window or document. r=ato,smaug
Registering listeners for the "beforeunload" and "unload" events currently
happens on the global window and document. This actually prevents Firefox
from adding those pages to the bfcache.

The correct is to add all the listeners to the tabchildglobal, which is
the framescript itself. Also by using the capture and not the bubble phase
the unload events are correctly propagaded to our registered listeners.

MozReview-Commit-ID: 4hJjuqWsoBP

--HG--
extra : rebase_source : 619a8c936f613823dab2387efa67dc65488fbbc3
2017-10-25 14:15:30 +02:00
Andreas Tolfsen 9644ecd998 Bug 1410799 - Catch error from element.Store#get in clickElement r=whimboo
Because the content frame script's clickElement function uses
the old-style despatch technique, all code lines that have the
potential of throwing must be encapsualted in try...catch blocks.
Bug 1400256 accidentally moved them outside this block, and we did
not have any tests for stale elements in web content.

This ensures errors from WebElement.fromJSON and seenEls.get get
returned to the WebDriver service in testing/marionette/driver.js.

MozReview-Commit-ID: 49qjWhXWy69

--HG--
extra : rebase_source : 3e1b639ad253c3fe7eda890de04608a925e256f5
2017-11-01 18:06:21 +00:00
Mark Banner 4de6bf22b1 Bug 1411368 - Automatically fix no-multi-spaces issues raised when using ESLint 4. r=mossop
MozReview-Commit-ID: H5YVp3rnzGo

--HG--
extra : rebase_source : 5b45b6c0df834131812d094e975047eaad374e06
2017-10-26 11:47:01 +01:00
Andreas Tolfsen c8ef9c9e6b Bug 1400256 - Adapt actions for implicitly unmarshaled elements. r=automatedtester
Since web element references are now implicitly unmarshaled when
they are passed to the content frame script, there is no need for
the actions module to check that the element origin is a reference
and try to look it up from the known element store.

MozReview-Commit-ID: 3BGBIBQMtR3

--HG--
extra : rebase_source : 1505fe15b060f85ad34628f34f67cfe96aaaa9c1
2017-10-09 19:55:27 +01:00
Andreas Tolfsen 84d01f24d6 Bug 1400256 - Marshal IPC messages to and from frame script. r=whimboo
MozReview-Commit-ID: BTDQDvu2pVE

--HG--
extra : rebase_source : 03f6c064dd0dbe973750cb5cfe5f9ae4ea86aee3
2017-10-05 17:57:17 +01:00
Andreas Tolfsen d9dd4eae1b Bug 1405018 - Consider current browsing context on staleness check. r=whimboo
The element.isStale function does not take into account the current
browsing context when checking an element’s staleness.  This means,
for example, that an element in an <iframe> that gets retrieved, will
still be considered valid for as long as its associated document lives.

In WebDriver the expected behaviour is for the element reference to
only be valid for the current browsing context, meaning retrieving
the element reference when another browsing context is chosen should
return a stale element error.

Fixes: https://github.com/mozilla/geckodriver/issues/934
MozReview-Commit-ID: JpQVt78u5AN
2017-10-10 15:06:21 +01:00
Andreas Tolfsen d28ce13224 Bug 1405279 - Remove unused variables. r=whimboo
MozReview-Commit-ID: CmiDVCw6xVK

--HG--
extra : rebase_source : e71cfb7da973d95c796a93cc1e4da6f709acf65e
2017-10-03 14:35:47 +01:00
Andreas Tolfsen 9ac995ab12 Bug 1400225 - Subscribe to and relay web content DOM events. r=automatedtester,whimboo
This makes it possible to subscribe to DOM events in web content, in
order to facilitate fixes for cases such as https://bugzil.la/1397007.

Although the current interface, WebElementEventTarget, is associated with
browser.Context (curBrowser) it is the intention that we in the future
will associate this with representations of the marshaled web element.
This will make it quack and act like an Element's EventTarget, which
has nice parity to it.

The WebElementEventTarget works by passing IPC messages to
a backend service in the content frame script implemented by
ContentEventObserverService.  This registers event handlers for specific
DOM events, and relays these events back to the browser-specific message
handler in chrome.

This will enable chrome code to wait for events to occur in content,
like this:

	await new Promise(resolve => {
	  webElement.addEventListener("visibilitychange", resolve, {once: true});
	  contentBrowser.minimize();
	});

MozReview-Commit-ID: B8MMHyG8n04

--HG--
extra : rebase_source : 25ac77fbcfb09435325719ac61614c4a8ce37996
2017-09-15 17:07:41 +01:00