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

661 Коммитов

Автор SHA1 Сообщение Дата
Andreas Tolfsen a71e8dea4a Bug 1464469 - Use MarionetteLog throughout. r=whimboo
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
2018-06-06 14:40:05 +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
Venkatesh Pitta c8db8adef3 Bug 1348145 - Remove getWindowPosition/setWindowPosition and getWindowSize/setWindowSize. r=whimboo
MozReview-Commit-ID: AUxPhJwOKB6

--HG--
extra : rebase_source : 7e80bcfa65e7285a07dcc957bc46368373e42126
2018-06-02 09:14:06 +10:00
David Burns 63b3aa0869 Bug 1387678 - Allow Marionette sendAsync command to handle null or undefinedr?ato r=ato
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
2018-05-03 11:00:26 +01:00
David Burns 3129272297 Bug 1387678 - Allow traversing to the parent if switchToShadowDom is given null; r=ato
MozReview-Commit-ID: KO1UwTyhf1R

--HG--
extra : rebase_source : 50d06af537ad997483b2d1cf27882f178399f8a7
2018-04-28 00:12:35 +01:00
Henrik Skupin e55c1dfc0c Bug 1461463 - [marionette] Empty response value should be null and not {}. r=ato
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
2018-05-15 15:17:41 +02:00
Henrik Skupin 1986106785 Bug 1461463 - [marionette] Add validation for known contexts. r=ato
MozReview-Commit-ID: 1t0hk5rdY1a

--HG--
rename : testing/marionette/harness/marionette_harness/tests/unit/test_with_using_context.py => testing/marionette/harness/marionette_harness/tests/unit/test_context.py
extra : rebase_source : 02e5e3ef11183e6ed8898934190f3d15840ef0b2
2018-05-24 16:47:30 +02: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
Kris Maglione a259026c9d Bug 1456035: Part 4 - Convert callers of XPCOMUtils.generateQI to ChromeUtils.generateQI. r=mccr8
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
2018-04-22 20:55:06 -07:00
Andreas Tolfsen 4e7776764d Bug 1456050 - Add marionette.contentListener to MarionettePrefs. r=whimboo
MozReview-Commit-ID: 1SPrw4Vwd3N

--HG--
extra : rebase_source : f2218a9ec0ebc3472a964abcca0bd1aa09ed2eb0
2018-04-23 07:26:09 +01:00
Andreas Tolfsen d964f30a08 Bug 1456050 - Add marionette.debugging.clicktostart to MarionettePrefs. r=whimboo
MozReview-Commit-ID: BAxcJFcv1uD

--HG--
extra : rebase_source : 7982a7e72b0c878621db896613f53599053c56e7
2018-04-23 07:17:44 +01:00
Andreas Tolfsen d458b76e52 Bug 1456051 - Make cert an ES module. r=maja_zf
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
2018-04-23 10:01:40 +01:00
Andreas Tolfsen 916ef8de56 Bug 1456051 - Make addon an ES module. r=maja_zf
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
2018-04-23 08:12:30 +01:00
Andreas Tolfsen 3e389d5b45 Bug 1452597 - Remove debug_script functionality for injected scripts. r=maja_zf
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
2018-04-09 13:13:18 +01:00
Andreas Tolfsen 7f65fc5fad Bug 1452487 - Remove directInject functionality in evaluate.sandbox. r=maja_zf
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
2018-04-08 18:03:29 +01:00
Henrik Skupin 105a8df3da Bug 1451727 - [marionette] Update vendor specific commands to use custom prefixes. r=ato
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
2018-04-05 21:23:57 +02:00
Henrik Skupin c15c7802d7 Bug 1451727 - [marionette] Add "WebDriver:AcceptAlert" in favor of "WebDriver:AcceptDialog". r=ato
To be consistent with the spec the command should be named
"WebDriver:AcceptAlert".

MozReview-Commit-ID: HGB9hJPAvcU

--HG--
extra : rebase_source : bbf3d657901784e1ab6e096edf1b20a5c43b0176
2018-04-05 15:50:28 +02:00
Peter Van der Beken 5e6f3328ec Bug 1448850 - Remove nsIMessageListener and nsIMessageListenerManager. r=bz.
--HG--
extra : rebase_source : 2938f6e1cb9078a6d45a8d58db0f6bf70e461b9c
2018-02-16 15:28:31 +01:00
Peter Van der Beken f5754d679a Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 6: Mark some IDL interfaces as non-scriptable. r=bz.
--HG--
extra : rebase_source : 5911f91bd7a63cd3603494e087e3858bd0527500
2018-03-01 20:19:56 +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
Andreas Tolfsen f7f73b417a Bug 1441226 - Rename NoAlertOpenError to NoSuchAlertError. r=whimboo
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
2018-02-26 17:35:30 +00:00
Csoregi Natalia 9553fd18e1 Backed out changeset fbe5a80f2f5b (bug 1441226) for linting Doc failures. CLOSED TREE 2018-03-01 16:55:25 +02:00
Andreas Tolfsen 3a1b1e0078 Bug 1441226 - Rename NoAlertOpenError to NoSuchAlertError. r=whimboo
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
2018-02-26 17:35:30 +00:00
Sebastian Hengst 3a10644021 Backed out 6 changesets (bug 888600) for beta simulation failures: build bustage on Linux and Windows opt (bug 1442036) and devtools failure browser_net_view-source-debugger.js (bug 1441961). a=backout
Backed out changeset 83c87140dc3d (bug 888600)
Backed out changeset 2efb9b1753f6 (bug 888600)
Backed out changeset af5303781961 (bug 888600)
Backed out changeset 79ef59047e63 (bug 888600)
Backed out changeset 30d568d628dd (bug 888600)
Backed out changeset c7bd4c6c9741 (bug 888600)

--HG--
extra : histedit_source : 791b22f6770f4fead2f909478a93d65d85829fe0%2Cbb387309e90f53e1dde45dcf8cf4ebedcc6e5c5e
2018-03-01 11:51:09 +02:00
Peter Van der Beken 6cf0e1c871 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 6: Mark some IDL interfaces as non-scriptable. r=bz.
--HG--
extra : rebase_source : f6f781b04923f67f60718706a78b3c4de15eca94
2018-02-22 20:22:29 +01: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
Andreas Tolfsen b7baba2225 Bug 1431462 - Remove Marionette:getVisibleCookies message listener. r=maja_zf
The Marionette:getVisibleCookies IPC message listener is not used.

MozReview-Commit-ID: G1N0F8jdLHH

--HG--
extra : rebase_source : 08e40fceae3d2a88c2ae88760d37c00bd8aecbca
2018-01-18 17:28:28 +00:00
Andreas Tolfsen 24ac581c5a Bug 1431155 - Move WindowState to Marionette browser module. r=automatedtester
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
2018-01-17 17:56:25 +00:00
Dorel Luca a0f25f9c56 Backed out changeset 4581da0d9525 (bug 1431155) for failing Browser-chrome on browser/base/content/test/static/browser_all_files_referenced.js on a CLOSED TREE 2018-01-18 17:09:45 +02:00
Andreas Tolfsen c45dec6136 Bug 1431155 - Move WindowState to Marionette browser module. r=automatedtester
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
2018-01-17 17:56:25 +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 20a23b6e23 Bug 1430077 - Broadcast Marionette:Deregister once. r=whimboo
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
2018-01-12 13:24:54 +00:00
Andreas Tolfsen 2861122a4c Bug 1430109 - Combine assert.window and assert.contentBrowser. r=maja_zf
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
2018-01-15 14:02:39 +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 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 844fad888d Bug 1423282 - Remove last remenants of frame.Manager. r=automatedtester
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
2017-12-05 21:28:59 +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 1ce25757d1 Bug 1423282 - Remove legacy action chain browser close guard. r=automatedtester,maja_zf
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
2017-12-05 21:05:37 +00:00
Andreas Tolfsen 74a8fcb707 Bug 1423282 - Drop Marionette:log IPC message. r=automatedtester
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
2017-12-05 18:46:49 +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
Andreas Tolfsen 1b0393bfa6 Bug 1423357 - Remove unused properties from GeckoDriver class. r=whimboo
MozReview-Commit-ID: 3tppkWZtCBP

--HG--
extra : rebase_source : fbcd6015295f9ced0a5c96e47e7e0b9554eacb54
2017-12-05 21:59:38 +00: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 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 4ee38f4584 Bug 1420431 - Allow WebElement to be returned from GeckoDriver. r=maja_zf
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
2017-11-24 16:20:21 +00:00
Nathaniel Nebel 103901d7dc Bug 1381459 - Allow closing of browserless tabs. r=whimboo
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
2017-11-24 03:11:18 -08:00
David Burns 08fa1187af Bug 1416284: Dismiss alerts when we hit an UnexpectedAlertOpen error. r=ato
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
2017-11-10 17:25:50 +00:00
Gijs Kruitbosch 469382710e Bug 1408044 - stop using about.dtd as an example in firefox-ui/puppeteer/marionette docs/tests, r=whimboo
MozReview-Commit-ID: 4zog9pSgCs9

--HG--
extra : rebase_source : 978a490b010179ded8b7ab3bdddf659fb0a331af
2017-11-14 23:37:04 +00:00
Noemi Erli 548d6fb5ab Backed out 2 changesets (bug 1416284) for Wd Linux debug failures e.g. in get_window_rect.py r=backout on a CLOSED TREE
Backed out changeset 8fc12fbc1422 (bug 1416284)
Backed out changeset ff138177269b (bug 1416284)
2017-11-18 02:43:31 +02:00
David Burns 6016775811 Bug 1416284: Dismiss alerts when we hit an UnexpectedAlertOpen error. r=ato
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
2017-11-10 17:25:50 +00:00
Ciure Andrei a8907fc95a Backed out 5 changesets (bug 1408044) for failing Android test: TestAboutPagesPreparer.java:24: cannot find symbol. r=backout on a CLOSED TREE
Backed out changeset 5c5152ad910d (bug 1408044)
Backed out changeset c9a062838c12 (bug 1408044)
Backed out changeset 9ceaa645f2a9 (bug 1408044)
Backed out changeset 10fc0a581606 (bug 1408044)
Backed out changeset 513140019014 (bug 1408044)
2017-11-17 12:19:30 +02:00
Gijs Kruitbosch c1e68c5edc Bug 1408044 - stop using about.dtd as an example in firefox-ui/puppeteer/marionette docs/tests, r=whimboo
MozReview-Commit-ID: 4zog9pSgCs9

--HG--
extra : rebase_source : 546415e95c83591d2077a9d6995e69d091a64f73
2017-11-14 23:37:04 +00:00
btara dc38bb2f52 Backed out 2 changesets (bug 1416284) for failing e.g. /webdriver/tests/minimize_window.py r=backout
on a CLOSED TREE
Backed out changeset dff6393650df (bug 1416284)
Backed out changeset b1474e3a2e94 (bug 1416284)

--HG--
extra : rebase_source : 0877a744252fdb0aeb022fc99fd8b117bdd2b628
2017-11-15 01:14:08 +02:00
David Burns 45d2ccaa1d Bug 1416284: Dismiss alerts when we hit an UnexpectedAlertOpen error. r=ato
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
2017-11-10 17:25:50 +00:00
Csoregi Natalia 8eea4c5d3b Backed out 2 changesets (bug 1416284) for unexpectedly passing WDSpec tests /webdriver/tests/set_window_rect.py r=backout
Backed out changeset b1a9e1788e2e (bug 1416284)
Backed out changeset 1902e83f331d (bug 1416284)
2017-11-14 02:44:31 +02:00
David Burns b695a4f813 Bug 1416284: Dismiss alerts when we hit an UnexpectedAlertOpen error. r=ato
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
2017-11-10 17:25:50 +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
Andreas Tolfsen 707c28df99 Bug 1410652 - Let WebDriver:SwitchToFrame take a web element. r=whimboo
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
2017-10-21 19:30:27 +01:00
Sebastian Hengst 7eb270c395 Backed out 4 changesets (bug 1410652) for eslint failure at testing/marionette/element.js: Line 1456 exceeds the maximum line length of 78. r=backout
Backed out changeset 97031d4ea2bd (bug 1410652)
Backed out changeset 66754caa4c52 (bug 1410652)
Backed out changeset 48048929bb17 (bug 1410652)
Backed out changeset 265a168b4e37 (bug 1410652)
2017-10-30 19:32:43 +01:00
Andreas Tolfsen 8c8b85caa1 Bug 1410652 - Let WebDriver:SwitchToFrame take a web element. r=whimboo
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
2017-10-21 19:30:27 +01: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 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 453b045c3a Bug 1400256 - Make element.Store work with web elements. r=whimboo
MozReview-Commit-ID: AitZAYFtpoF

--HG--
extra : rebase_source : eabb69bb1e6f39ef17d511f20b033eb760fe55a2
2017-10-05 18:01:35 +01:00
Andreas Tolfsen 3e13cd2cbc Bug 1400256 - Use WebElement.generateUUID to make session ID. r=whimboo
MozReview-Commit-ID: FuYeCDySLu

--HG--
extra : rebase_source : f6945b7e073e0bb95d2fb13927b9229ec691f157
2017-10-05 17:11:26 +01:00
Andreas Tolfsen ac39cffaab Bug 1408508 - Move Context to browser module. r=maja_zf
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
2017-10-16 17:47:35 +01:00
Sebastian Hengst 164fef69ff Backed out changeset 286a5ba56cec (bug 1408508) for eslint failure at testing/marionette/driver.js:881:50 | 'resp' is defined but never used. r=backout
--HG--
extra : amend_source : becc15136f2e7113ab248154be37dfa2bf923dc9
2017-10-18 20:28:15 +02:00
Andreas Tolfsen 4092fd5b34 Bug 1408508 - Move Context to browser module. r=maja_zf
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
2017-10-16 17:47:35 +01:00
Andreas Tolfsen c9ec6362dc Bug 1409379 - Move WindowState to new wm module. r=maja_zf
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
2017-10-17 14:20:52 +01:00
Peter Major 240cafe846 Bug 1407675 - Fix cookie creation via Marionette using IP address r=ato
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
2017-10-12 16:06:26 +01:00
Henrik Skupin b5ddfae9aa Bug 1407925 - Don't use application name but ID to determine Firefox. r=ato
MozReview-Commit-ID: 9TZrs4nk31y

--HG--
extra : rebase_source : a79e15619e5b25dd494ba0be5bb0e84ec67dab86
2017-10-12 13:21:17 +02:00
Andreas Tolfsen d416473355 Bug 1405325 - Align WebDriver:DeleteCookie with specification. r=maja_zf
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
2017-10-03 16:25:57 +01:00
Andreas Tolfsen a5fa626acc Bug 1404946 - Rename wait.until to PollPromise. r=whimboo
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
2017-10-02 16:50:11 +01:00
Andreas Tolfsen f9a974ff5b Bug 1404946 - Rename wait module to sync. r=whimboo
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
2017-10-02 16:38:33 +01:00
Sebastian Hengst a867e38354 Backed out changeset 231a24060d29 (bug 1404946) for linting failure at testing/marionette/driver.js:3054:35 | 'f' is defined but never used. r=backout
--HG--
rename : testing/marionette/sync.js => testing/marionette/wait.js
extra : amend_source : 009478a65c290d4b7540723f157de57dbe19901e
2017-10-09 16:23:15 +02:00
Sebastian Hengst c9b41f4cb7 Backed out changeset bf79d5b1b4b0 (bug 1404946) 2017-10-09 16:23:04 +02:00
Andreas Tolfsen 0fb99a7cd4 Bug 1404946 - Rename wait.until to PollPromise. r=whimboo
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
2017-10-02 16:59:25 +01:00
Andreas Tolfsen 583c91fabd Bug 1404946 - Rename wait module to sync. r=whimboo
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
2017-10-02 16:38:33 +01:00
Henrik Skupin 21872db2c4 Bug 1406150 - Always throw exceptions by using 'new'. r=maja_zf
MozReview-Commit-ID: GmI1PuSQwWU

--HG--
extra : rebase_source : 61d87d94d683094a579d776e10134dc961182969
2017-10-06 14:07:13 +02: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 e3681ac449 Bug 1400226 - Wait for visibilitychange event on window minimize/restore. r=whimboo
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
2017-09-21 15:02:36 +01:00
Andreas Tolfsen bbf5d23b36 Bug 1396866 - Restore window state on maximizing, minimizing, and fullscreening. r=automatedtester
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
2017-09-09 12:20:40 +01:00
Andreas Tolfsen 8a7c17f04e Bug 1396618 - Throttle window minimize and restore r=automatedtester
MozReview-Commit-ID: 5LUWYwURQgs

--HG--
extra : rebase_source : fcc47b5994b356fad670cc56cc03f0976338a950
2017-09-04 16:55:34 +01:00
Henrik Skupin 269febe5eb Bug 1387470 - Use moz:webdriverClick capability for spec conforming element click. r=ato
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
2017-09-01 17:11:35 +02:00
Andreas Tolfsen 29f6ebe13f Bug 1394881 - Use Node.isConnected for web element staleness check. r=automatedtester
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
2017-08-30 14:22:39 +01:00
Andreas Tolfsen aeb61b530d Bug 1395176 - Lint testing/marionette for var usage. r=automatedtester
MozReview-Commit-ID: FCcyuUVJC7J

--HG--
extra : rebase_source : b6f16c2b2118aff532dd7480304bcd94aa739148
2017-08-30 17:38:23 +01:00
Henrik Skupin 8c9c9c7b11 Bug 1369827 - Make proxy port an optional suffix for the host. r=ato
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
2017-08-18 14:49:00 +02:00
Andreas Tolfsen c07ee45e6b Bug 1392339 - Fix misuse of nsIDOMElement in API docs. r=automatedtester
MozReview-Commit-ID: 3q35q6TTbTH

--HG--
extra : rebase_source : 07b2d26874a051a8b6663020ee49dcd20beb286c
2017-08-21 18:56:19 +01:00
Andreas Tolfsen 34a091cffa Bug 1392339 - Fix misuse of nsIDOMWindow in API docs. r=automatedtester
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
2017-08-21 18:52:18 +01:00
Andreas Tolfsen 657e3f287d Bug 1391691 - Make WebDriver:FullscreenWindow idempotent. r=automatedtester
MozReview-Commit-ID: 4AQlYYNV03f

--HG--
extra : rebase_source : 2b4c8bb55292665925411025e952367f1af27123
2017-08-18 18:32:11 +01:00
Andreas Tolfsen a4b0685950 Bug 1391691 - Make WebDriver:MaximizeWindow idempotent. r=automatedtester
MozReview-Commit-ID: EJ0VQOTWysg

--HG--
extra : rebase_source : 8f97877c78c04672acd715db82b98133330372db
2017-08-18 18:31:42 +01:00
Andreas Tolfsen bd75d1ac7c Bug 1391691 - Make WebDriver:MinimizeWindow idempotent. r=automatedtester
MozReview-Commit-ID: 4XBw0UFfZ1O

--HG--
extra : rebase_source : ced1fb5e6add0b2688c3e6cc0740eb9a9e54456a
2017-08-18 18:30:50 +01:00
Andreas Tolfsen d93ed539e8 Bug 1391691 - Rename GeckoDriver#fullscreen to fullscreenWindow. r=automatedtester
The other window state manipulation commands are named minimizeWindow
and maximizeWindow.

MozReview-Commit-ID: IBVqJSRwG8x

--HG--
extra : rebase_source : a1efaf7cf2a5c068b62c60453b1f8814d34b043b
2017-08-18 18:29:47 +01:00
Wes Kocher 75e9f7dbef Backed out 10 changesets (bug 1391691) for wpt failures a=backout
Backed out changeset 666ac679317e (bug 1391691)
Backed out changeset 46f82e1e2cde (bug 1391691)
Backed out changeset 1fd98ace1473 (bug 1391691)
Backed out changeset 5bddbd90ec7c (bug 1391691)
Backed out changeset 4653134d01ef (bug 1391691)
Backed out changeset fd88b612ac2e (bug 1391691)
Backed out changeset 6306abc0b5e9 (bug 1391691)
Backed out changeset 649b0e761c87 (bug 1391691)
Backed out changeset 6c48daaad075 (bug 1391691)
Backed out changeset 17aeed1f6454 (bug 1391691)

MozReview-Commit-ID: 6Cw1QibNQKM

--HG--
extra : rebase_source : 0197f824719f11e113595dd9a4a86b2c8d1fd8fe
2017-08-21 09:19:10 -07:00
Andreas Tolfsen ab34c37f43 Bug 1391691 - Make WebDriver:FullscreenWindow idempotent. r=automatedtester
MozReview-Commit-ID: 4AQlYYNV03f

--HG--
extra : rebase_source : ab85f647405a23d249c3c79413382004b9d5ba90
2017-08-18 18:32:11 +01:00
Andreas Tolfsen fd1746e875 Bug 1391691 - Make WebDriver:MaximizeWindow idempotent. r=automatedtester
MozReview-Commit-ID: EJ0VQOTWysg

--HG--
extra : rebase_source : 8fa9ab528c30f11d791b0e49f36661957f19befa
2017-08-18 18:31:42 +01:00
Andreas Tolfsen 9e4a620575 Bug 1391691 - Make WebDriver:MinimizeWindow idempotent. r=automatedtester
MozReview-Commit-ID: 4XBw0UFfZ1O

--HG--
extra : rebase_source : c2de251b5e994710ae197e63b7413a321f490900
2017-08-18 18:30:50 +01:00
Andreas Tolfsen 017325b653 Bug 1391691 - Rename GeckoDriver#fullscreen to fullscreenWindow. r=automatedtester
The other window state manipulation commands are named minimizeWindow
and maximizeWindow.

MozReview-Commit-ID: IBVqJSRwG8x

--HG--
extra : rebase_source : 29271a475a847ca15c1d8f736520b238c0818791
2017-08-18 18:29:47 +01:00
Andreas Tolfsen 5906316d3c Bug 1388036 - Restore window when setting window rect. r=automatedtester
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
2017-08-18 16:01:24 +01:00
Andreas Tolfsen c44c39fe1c Bug 1391952 - Disable camel case lint for input and output. r=automatedtester
MozReview-Commit-ID: 5KargkSvSPn

--HG--
extra : rebase_source : 45974434b348aed13a50fe4c98f11fc39217723c
2017-08-19 14:21:43 +01:00
Andreas Tolfsen 6c36c123e0 Bug 1391952 - Lint testing/marionette. r=automatedtester
MozReview-Commit-ID: CdA2gkIaul7

--HG--
extra : rebase_source : a3c4b785da01c19d8ef41cb3628a4844ec518ca2
2017-08-19 14:22:17 +01:00
Andreas Tolfsen ac8a376af8 Bug 1388082 - Convert execute script methods to async. r=automatedtester
MozReview-Commit-ID: 6oUZ4v8snh0

--HG--
extra : rebase_source : 1ce7c286b0bce68ffaf74a6c8235ce57ca39af8a
2017-08-07 16:53:02 +01:00
Andreas Tolfsen 351fdfb92f Bug 1388082 - Make WebDriver service use async/await. r=automatedtester
MozReview-Commit-ID: A1dW91OvGcG

--HG--
extra : rebase_source : af8cf1d157f2fe4fdcd0e96b06ebe87e23d22a73
2017-08-07 16:52:37 +01:00
Andreas Tolfsen 94e1614eb3 Bug 1388424 - Read capabilities off top-level object. r=whimboo
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
2017-08-11 11:06:15 +02:00
Andreas Tolfsen a791c795cb Bug 1387380 - Stop capabilities negotiation in Marionette. r=whimboo
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
2017-08-04 20:04:12 +01:00
Sebastian Hengst b52285fffc merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: LBuvGxGDK9k
2017-08-06 11:05:44 +02:00
Andreas Tolfsen da6629ba61 Bug 1387559 - Drop session_id fallback for WebDriver:NewSession. r=automatedtester
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
2017-08-05 17:35:54 +01:00
Andreas Tolfsen 5ec99cbafd Bug 1387457 - Convert element click functions to async. r=automatedtester
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
2017-08-05 17:21:06 +01:00
Andreas Tolfsen e6afed160b Bug 1381876 - Ensure Maximize Window is synchronous. r=automatedtester
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
2017-08-01 18:30:52 +01:00
Andreas Tolfsen adf6b1ae3e Bug 1381876 - Return window rect from Context#rect consistently. r=automatedtester
MozReview-Commit-ID: D5pCPK2PEr3

--HG--
extra : rebase_source : a9e6c80314084a6b9fe3b4313d1599911528297b
2017-08-01 18:17:29 +01:00
Phil Ringnalda 2685e4feb0 Backed out changeset 8bd84dfdba0d (bug 1387457) for eslint bustage
MozReview-Commit-ID: 4wgm2jnoDsl
2017-08-04 19:41:37 -07:00
Andreas Tolfsen 2777c1c3a7 Bug 1387457 - Convert element click functions to async. r=automatedtester
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
2017-08-04 15:45:02 +01:00
Andreas Tolfsen d29f92675d Bug 1385547 - Lint testing/marionette. r=automatedtester
Automatic fixes from './mach lint --fix testing/marionette'.

MozReview-Commit-ID: 4UOLrLLxMbH
2017-07-31 16:01:12 +01:00
Yangyi Peng fbec312f36 Bug 1378121 - Add WebDriver:MinimizeWindow command to Marionette; r=ato
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
2017-07-21 17:00:41 +08:00
Andreas Tolfsen dd7a57fd22 Bug 1384517 - Fix testing/marionette API docs; r=automatedtester
Various fixes to make the generated API documentation from
testing/marionette somewhat easier to read.

MozReview-Commit-ID: F9duuQoOYBt

--HG--
extra : rebase_source : 3ade69773ceba42826aedef05b1371240b51cf82
2017-07-26 13:11:53 +01:00
Andreas Tolfsen 57744ed223 Bug 1378227 - Reintroduce window test for Marionette:GetWindowRect; r=whimboo
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
2017-07-09 17:15:28 +01:00
Henrik Skupin 29253dbd89 Bug 1374672 - Use documentURI instead of baseURI. r=automatedtester
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
2017-07-07 15:36:08 +02:00
Henrik Skupin 618082fc0c Bug 1332122 - Re-register the browser for frame script reloads. r=automatedtester
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
2017-07-06 18:02:19 +02:00
Henrik Skupin d373a550b4 Bug 1332122 - Remove unnecessary wrapper browser.startSession(). r=automatedtester
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
2017-07-04 10:27:54 +02:00
Henrik Skupin c9b6fbb461 Bug 1378191 - Use JSON to send capabilities in "Marionette:listenersAttached" r=automatedtester
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
2017-07-04 21:03:36 +02:00
Henrik Skupin 3aa7fa87be Bug 1368439 - Retrieve content browser title via parent process. r=automatedtester
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
2017-07-02 04:31:18 -07:00
Henrik Skupin 2af21d96fe Bug 1368439 - Remove unused GetAppCacheStatus command. r=automatedtester
MozReview-Commit-ID: ARETprd7n8t

--HG--
extra : rebase_source : cacb5051de689f73156f4460bcd47de0f09f2df1
2017-07-02 13:55:12 +02:00
Andreas Tolfsen de001d80b7 Bug 1376128 - Lint testing/marionette; r=automatedtester
MozReview-Commit-ID: DY4yCSBEZrN

--HG--
extra : rebase_source : d4e25369418cc72a6ee9f78d44b050a87403391d
2017-06-29 16:40:24 -07:00
Andreas Tolfsen 8f8617afe9 Bug 1376128 - Remove duplicated command entries; r=automatedtester
getContext and setContext are duplicated further up under the Marionette
serivce entries.

MozReview-Commit-ID: 2V5S2XG6wDw

--HG--
extra : rebase_source : 1f22adc294c063f014e3a0e884a01ed6a7fbe43e
2017-06-28 11:14:16 -07:00
Andreas Tolfsen b86d19c98a Bug 1376128 - Expose unrecognised eslint globals; r=automatedtester
In particular, XPCNativeWrapper should probably be made available
by default.

MozReview-Commit-ID: E1oYFyApbLi

--HG--
extra : rebase_source : 4e27ad6882bd4e43dadc97d4fd2a186e01510dfd
2017-06-28 11:04:14 -07:00
Andreas Tolfsen 54c2f296a7 Bug 1376128 - Use selective imports from error module; r=automatedtester
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
2017-06-28 11:01:49 -07:00
Andreas Tolfsen 0025816358 Bug 1376586 - Add back quitApplication command alias; r=davehunt
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
2017-06-27 14:48:36 -07:00
Henrik Skupin 200da78a40 Bug 1223277 - Return immediately when click command closes tab or window. r=ato
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
2017-06-26 16:55:02 -07:00
James Graham 5fd8e99e6a Bug 1363428 - Add reftest-specific endpoints to Marionette, r=ato
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
2017-06-24 12:03:11 +01:00
James Graham 90846c0258 Bug 1363428 - Make it possible to close tabless content windows, r=ato
MozReview-Commit-ID: 8xltsYCN3QA
2017-06-24 12:03:10 +01:00
James Graham dc2eb76fe1 Bug 1363428 - Handle top level reftest window specially in Marionette, r=ato
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
2017-06-24 12:03:10 +01:00
James Graham 860166c010 Bug 1363428 - Refactor Marionette switchToWindow implementation, r=ato
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
2017-06-24 12:03:10 +01:00
James Graham 2994bec9c1 Bug 1363428 - Use an iterator for iterating windows, r=ato
MozReview-Commit-ID: FKsw9EST2H7
2017-06-24 12:03:10 +01:00
Wes Kocher ea40157e54 Backed out 16 changesets (bug 1363428) for Wr failures a=backout CLOSED TREE
Backed out changeset e86d6d5c2a25 (bug 1363428)
Backed out changeset a0687a63e7b9 (bug 1363428)
Backed out changeset 858dc97498c7 (bug 1363428)
Backed out changeset 582a8dce7932 (bug 1363428)
Backed out changeset 26ae2fd48587 (bug 1363428)
Backed out changeset 7fa8e20fe001 (bug 1363428)
Backed out changeset 829c13a75667 (bug 1363428)
Backed out changeset a94d2c400b04 (bug 1363428)
Backed out changeset ec4a6b343b37 (bug 1363428)
Backed out changeset c27b94038e71 (bug 1363428)
Backed out changeset d1c03b96d270 (bug 1363428)
Backed out changeset 60c1c95b46ca (bug 1363428)
Backed out changeset b0604d88973f (bug 1363428)
Backed out changeset f0b218979773 (bug 1363428)
Backed out changeset 1d359561373c (bug 1363428)
Backed out changeset 956d6c0a646e (bug 1363428)

MozReview-Commit-ID: K8EBA8ACZLC
2017-06-23 14:13:27 -07:00
James Graham c9e960f859 Bug 1363428 - Add reftest-specific endpoints to Marionette, r=ato
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
2017-05-10 10:51:10 +01:00
James Graham 2859180072 Bug 1363428 - Make it possible to close tabless content windows, r=ato
MozReview-Commit-ID: 8xltsYCN3QA

--HG--
extra : rebase_source : d872ea84c98203485815b5082088ce148e2b4411
2017-06-09 18:28:10 +01:00
James Graham c5fde398ab Bug 1363428 - Handle top level reftest window specially in Marionette, r=ato
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
2017-05-09 19:05:49 +01:00
James Graham 5615725398 Bug 1363428 - Refactor Marionette switchToWindow implementation, r=ato
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
2017-05-09 18:59:09 +01:00
James Graham a79e689564 Bug 1363428 - Use an iterator for iterating windows, r=ato
MozReview-Commit-ID: FKsw9EST2H7

--HG--
extra : rebase_source : 87ae70226adf947e4b7990348ba94b277cff11d1
2017-05-09 17:49:09 +01:00
Ryan VanderMeulen dacc2546ba Backed out 6 changesets (bug 1223277) for causing Marionette test regressions.
Backed out changeset 85c86dc86122 (bug 1223277)
Backed out changeset aacd8d27b192 (bug 1223277)
Backed out changeset e6921a7229a3 (bug 1223277)
Backed out changeset b9f95fc81d23 (bug 1223277)
Backed out changeset 547744157e2a (bug 1223277)
Backed out changeset afbaa1138de3 (bug 1223277)
2017-06-23 12:15:23 -04:00
Henrik Skupin 9737c986a6 Bug 1223277 - Return immediately when click command closes tab or window. r=ato
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
2017-05-24 21:44:37 +02:00
Andreas Tolfsen b51e4887c3 Bug 1371733 - Move cookie service to chrome space; r=whimboo
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
2017-06-12 18:05:22 +01:00
Andreas Tolfsen ef6448769d Bug 1371733 - Encode currentURL as URL object; r=whimboo
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
2017-06-13 14:46:59 +01:00