Commit Graph

3048 Commits

Author SHA1 Message Date
Sebastian Hengst
0b72ecf4c3 Backed out changeset 6960879cb1e3 (bug 1407695) for eslint failure at testing/marionette/cookie.js:219: ["expiry"] is better written in dot notation. r=backout
--HG--
extra : rebase_source : 47471c300affde3ecccaf905d6650cf130aab3de
2017-10-24 18:48:58 +02:00
Henrik Skupin
627af45f04 Bug 1410366 - Improve socket handling in wait_for_port r=ato
The temporarily created sockets have to be removed immediately
by the operating system. Otherwise those enter the TIME_WAIT state,
and will be removed about 90s later. This can cause a pile of orphaned
sockets.

MozReview-Commit-ID: BGy9ZOjhjT0

--HG--
extra : rebase_source : f2e96d3e8d5d022b18c5f73daa15f3f8f06c74c5
2017-10-20 14:54:03 +02:00
Henrik Skupin
adf9cae288 Bug 1410366 - Stop socket server from listening for new connections if told so. r=ato
Simply checking '_acceptConnections' when clients are trying to
connect to Marionette, and revoking the connection request inside
of 'onSocketAccepted' is plainly wrong, given that a connection is
already present.

Instead put the socket server into close state, which means it
does no longer listen for new connection attempts until new
connections are accepted again.

MozReview-Commit-ID: JIpOgOjnpDY

--HG--
extra : rebase_source : 6caa49fa81aec4a5fcf4bdbd3a4290b837a14281
2017-10-23 14:08:15 +02:00
Øyvind Strømmen
d6d4b4b5e4 Bug 1407695 - Do not return expiry key for session cookies; r=ato
MozReview-Commit-ID: 7qAgwSZx9JI

--HG--
extra : rebase_source : bc59f1b653b61f262a10e366cc88a4bcd535b4e2
2017-10-16 22:42:48 +02:00
Sebastian Hengst
354425a911 Backed out changeset f4152054eb1b (bug 1410366) for Marionette mass failures, at least on Android 4.3 API16+ debug. r=backout on a CLOSED TREE
--HG--
extra : amend_source : 85858d56ec95c0802a1346f8a5bcf2a66bfca118
2017-10-23 20:34:12 +02:00
Sebastian Hengst
85b2276598 Backed out changeset 43e45144dd9f (bug 1410366) 2017-10-23 20:34:06 +02:00
Henrik Skupin
86d28c15bf Bug 1410366 - Improve socket handling in wait_for_port r=ato
As the method name describes the primary functionality of this method
should be to wait for the specific port to be reachable. Specific
application verification is done anyway in the 'newSession' command.

Also the temporarily created sockets have to be removed immediately
by the operating system. Otherwise those enter the TIME_WAIT state,
and will be removed about 90s later. This can cause a pile of orphaned
sockets.

MozReview-Commit-ID: BGy9ZOjhjT0

--HG--
extra : rebase_source : 54ce1fe1f9cd82dc53e205be057f11d99ccb4291
2017-10-20 14:54:03 +02:00
Henrik Skupin
a116d561e4 Bug 1410366 - Stop socket server from listening for new connections if told so. r=ato
Simply checking '_acceptConnections' when clients are trying to
connect to Marionette, and revoking the connection request inside
of 'onSocketAccepted' is plainly wrong, given that a connection is
already present.

Instead put the socket server into close state, which means it
does no longer listen for new connection attempts until new
connections are accepted again.

MozReview-Commit-ID: JIpOgOjnpDY

--HG--
extra : rebase_source : 6caa49fa81aec4a5fcf4bdbd3a4290b837a14281
2017-10-23 14:08:15 +02:00
Henrik Skupin
18f2f9d641 Bug 1410355 - Re-enable Marionette unit tests for ASAN builds except crash tests. r=ato
For ASAN builds the crashreporter is not available. As such the unit
tests for crash handling should not be executed. But it should be fine
to re-enable all the other unit tests.

MozReview-Commit-ID: BPFshl7vvqM

--HG--
extra : rebase_source : b40805e0e681eb75c7351299351447860144ba56
2017-10-23 10:30:08 +02: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
179b8ccc6b Bug 1400256 - Recognise web element references in evaluate.toJSON. r=whimboo
MozReview-Commit-ID: BvKHGzsF0ie

--HG--
extra : rebase_source : f3e66b5173534193f357593e0d292199f4efe764
2017-10-05 17:55:52 +01:00
Andreas Tolfsen
34a0935ad5 Bug 1400256 - Use WebElement for marshaling web elements in evaluate.fromJSON. r=whimboo
MozReview-Commit-ID: KwjZ60WlyKp

--HG--
extra : rebase_source : c000e9a2e9607a6804813bfb05efa86460e167a6
2017-10-05 17:55:31 +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
0a60b466bc Bug 1400256 - Use web element references in action tests. r=whimboo
MozReview-Commit-ID: 2D3PdriqjYz

--HG--
extra : rebase_source : 62dabe7bf4349d79afc81abdcc68b73bf48ae894
2017-10-09 16:40:11 +01:00
Andreas Tolfsen
8153637695 Bug 1400256 - Drop unused arguments to evaluate.toJSON/fromJSON. r=whimboo
MozReview-Commit-ID: 8q0PK3M4rif

--HG--
extra : rebase_source : a7d7c4885eaa1a5a707d6cbb805b0e3b76a733be
2017-10-05 17:53:25 +01:00
Andreas Tolfsen
936135f0ac Bug 1400256 - Serialise IPC messages with evaluate.toJSON. r=whimboo
Instead of having commands serialising their own JSON-safe messages
when communicating with the content frame script, this patch changes
the AsyncMessageChannel to use evaluate.toJSON.

MozReview-Commit-ID: LmAVGEjqMTB

--HG--
extra : rebase_source : 7f39cccc1468217a8a6bcf107241fd5648cb24d2
2017-10-05 17:50:34 +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
b4fef406e1 Bug 1400256 - Remove element.isWebElementReference. r=whimboo
Remove element.isWebElementReference in favour of
WebElement.isReference.

MozReview-Commit-ID: IOqx7XMUfCu

--HG--
extra : rebase_source : e25b0f709d3c11a6a26b937e9a72ca861fe34730
2017-10-05 17:07:48 +01:00
Andreas Tolfsen
b6d0e8ec91 Bug 1400256 - Add web element abstractions. r=whimboo
This patch introduces a series of web element abstraction types for
representing web element references.

Adds a series of new types for representing web element references
in Marionette: ChromeWebElement, ContentWebElement, ContentWebFrame,
and ContentWebWindow.  The last three are direct representations of
web element, web frame, and web window definitions described in the
Webdriver specification.  The first is a custom Marionette type as
we also support retrieving XUL elements from chrome space and must
be considered proprietary.

Each of the classes extend the WebElement abstract type, which is
the primary entry point when unmarshaling JSON input from the client.
Based on the characteristics of the JSON Object, one of the different
concrete types will be constructed.

The purpose of this change is to make marshaling of elements and
WindowProxies easier, both when we receive web element reference
objects from clients and when transporting them over IPC internally.

The WebElement.fromUUID function should be considered a temporary
workaround until we have fixed the current Marionette clients to send
web element reference JSON Objects as input, instead of plain {id:
<uuid>, …} fields.

MozReview-Commit-ID: FGcRq5H1Tzp

--HG--
extra : rebase_source : fe82087e8935adb519e2934fc37f1d46c21d9187
2017-10-13 19:23:45 +01:00
Blake Kaplan
3fa965430b Bug 1406212 - Remove references to extensions.e10sBlocksEnabling. r=Felipe
MozReview-Commit-ID: 11q3Go0IkPh

--HG--
extra : rebase_source : fdcf714d18effc964191665eb8422305bda92b65
2017-10-16 13:52:48 -07:00
Blake Kaplan
448808fee2 Bug 1406212 - Remove browser.tabs.remote.autostart.N. r=Felipe
These are no longer needed.

MozReview-Commit-ID: C49R7GsWPDg

--HG--
extra : rebase_source : 3711365017bf48c1f53315ce48fa419ac2a89b3e
2017-10-10 16:12:20 -07: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
a03f21ac1c Bug 1409040 - Add element.isElement shorthand. r=maja_zf
Introduces new element.isElement shorthand API for identifying DOM-,
SVG-, and XUL elements.

It is the equivalent of this:

	if (element.isDOMElement(el) ||
	    element.isSVGElement(el) ||
	    element.isXULElement(el)) {
	  // ...
	}

MozReview-Commit-ID: H8MDkP5bQmW

--HG--
extra : rebase_source : 6bef09999e47b178614e4bd307266b4449f39901
2017-10-17 14:53:42 +01:00
Andreas Tolfsen
b23b5f643a Bug 1409040 - Add element.isSVGElement. r=maja_zf
MozReview-Commit-ID: 4VCjHCnO3QB

--HG--
extra : rebase_source : f74e6a2ab48dfc59bc53b12f24e8a21131d8712c
2017-10-16 14:25:53 +01:00
Andreas Tolfsen
ded7e79114 Bug 1409040 - Add element.isDOMWindow. r=maja_zf
In addition to tell DOM- and XUL elements apart we will in the
future need to identify WindowProxies because WebDriver expects
there to be a separate "web window" serialisation for these.

Telling if an abritrary object is a WindowProxy is tricky but we
check if its node.toString is callable, that it returns "[object
Window"], and finally that its "self" attribute is itself.  This is
not perfect, but good enough for now.

MozReview-Commit-ID: 6FLOa3qYLPP

--HG--
extra : rebase_source : 27d25d97facf73761a1600e88d938eb76b3bc005
2017-10-13 19:22:01 +01:00
Andreas Tolfsen
8d4160ddc0 Bug 1409040 - Add element.isDOMElement. r=maja_zf
Introduces a new element.isDOMElement function, similar to isXULElement,
for checking whether an element is a DOM element.

It follows the same formula as isXULElement by first testing if the
element is an object so we know we can accesss node.namespaceURI
and node.nodeType without causing a JS error.

MozReview-Commit-ID: 6Mlo33vu5LG

--HG--
extra : rebase_source : 547a2fc5bc0051e3bb51e14add4f57d1ff7972b9
2017-10-13 19:20:26 +01:00
Andreas Tolfsen
6332833688 Bug 1409040 - Make element.isXULElement more resiliant. r=maja_zf
Fixes isXULElement to recognise XBL elements, such as <xbl:framebox>.

Also tightens up the input checks so that arbitrary objects can be
tested, as checking node.namespaceURI directly could cause a JS error
if node is not an object.  Before checking the namespace we also ensure
it's an element node so that text- and comment nodes are not picked up.

This patch also introduces tests, which were sorely missing.

MozReview-Commit-ID: 8LNF1z3X1gP

--HG--
extra : rebase_source : ffacc5b1336b35624aaf0534101ce5c3fbdeaa95
2017-09-16 14:37:21 +01: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
Henrik Skupin
616e9c78ff Bug 1396880 - Skip not relevant checks in test_accessibility for webdriver click. r=ato
The test currently performs checks which will no longer raise the expected
accessibility exceptions if the webdriver conforming click is enabled. In
such a condition those specific situations are already covered in
test_click.py.

As long as the legacy click has not been fully removed keep running the
checks but only if the webdriver click is not in use.

MozReview-Commit-ID: 1DbKfJYADp

--HG--
extra : rebase_source : 2f56caf977f88768b1df2ad507587091af8708ba
2017-10-18 14:22:19 +02: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
Andreas Tolfsen
2207b79606 Bug 1409036 - Return single anon element from WebDriver:FindElement. r=whimboo
The WebDriver:FindElement command returned an array of elements when
looking up anonymous elements.  This patch rectifies the behaviour
so that only a single element is returned.

It introduces a new helper function called element.findAnonymousNodes,
akin to similar helper functions for other strategies.  This function
returns an iterator of anonymous nodes so that WebDriver:FindElements
(plural) and WebDriver:FindElement (singular) can share the same
code path.

MozReview-Commit-ID: 3IqPyAIZHtf

--HG--
extra : rebase_source : ceffd2b3dfe885b98ae31905f290ab9d95ef26c0
2017-10-05 12:59:03 +01:00
Andreas Tolfsen
1c615cbec1 Bug 1409031 - Fix element.isBooleanAttribute markup. r=whimboo
MozReview-Commit-ID: JIH3y0FlT37

--HG--
extra : rebase_source : 46db24fc9cc340c3149e79fa02829691e1107a64
2017-10-16 15:30:57 +01:00
Andreas Tolfsen
fc5df925f7 Bug 1409031 - Fix element.isInView markup. r=whimboo
MozReview-Commit-ID: LYe8XbGufIe

--HG--
extra : rebase_source : 7e6a82050b1de2ae972ba19501d5dd7502c67cc7
2017-10-16 15:30:23 +01:00
Andreas Tolfsen
a3451d8418 Bug 1409031 - Correct markup for element.getContainer docs. r=whimboo
MozReview-Commit-ID: KkfKLxy8cmJ

--HG--
extra : rebase_source : 34efea7f9489f980c59d89d5a20b8933f6566df9
2017-10-16 15:28:47 +01:00
Andreas Tolfsen
3e17e4b075 Bug 1409031 - Document element.isCollection. r=whimboo
MozReview-Commit-ID: EPNA642phzp

--HG--
extra : rebase_source : a63c722635e6d073a8179c787494c42525fdb1eb
2017-09-16 14:35:41 +01:00
Andreas Tolfsen
f37c62dc56 Bug 1409031 - Fix element.findByLinkText docs. r=whimboo
MozReview-Commit-ID: 86JggzRlwMN

--HG--
extra : rebase_source : 6b1d383678a2b5f9472669a8dcb5637c5bf90b63
2017-10-05 12:56:28 +01:00
Henrik Skupin
caee938960 Bug 1409030 - Remove Marionette socket protocol levels below 3. r=ato
MozReview-Commit-ID: LmjyuBuRvhk

--HG--
extra : rebase_source : 8d2f65b2d4ec04b7a9bf75271fdf07fdbfc8a9a1
2017-10-16 16:42:06 +02:00
Andreas Tolfsen
af54674287 Bug 1407990 - Move protocol definition to doc/Protocol.md. r=maja_zf
DONTBUILD

MozReview-Commit-ID: 6U9vpIvFtJR

--HG--
extra : rebase_source : 04851c75e47691bbe69f1d0d6071d10241e0f573
2017-10-13 17:08:57 +01:00
Andreas Tolfsen
03d523593a Bug 1407990 - Move Python test docs in tree. r=maja_zf
This is a liberal port of
https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/Marionette_Python_Tests.

DONTBUILD

MozReview-Commit-ID: 9gnITThr9A6

--HG--
extra : rebase_source : adb1b42d092f78b9d16ac191c12396e1110967a1
2017-10-13 17:06:58 +01:00
Andreas Tolfsen
06370d2e05 Bug 1407990 - Remove link to using Marionette with WebDriver. r=maja_zf
This page is now covered by geckodriver documentation and most
Selenium clients have built-in support for geckodriver.

DONTBUILD

MozReview-Commit-ID: BrqqU8trbRU

--HG--
extra : rebase_source : a699eb206915995b4fda6c6b6542dd58bcf5613c
2017-10-13 16:50:53 +01:00
Andreas Tolfsen
bbb7a7cc7f Bug 1407990 - Drop questions/comments secton from doc/Intro.md. r=maja_zf
This information is already covered in README.md.

DONTBUILD

MozReview-Commit-ID: CoaPQeIyNmA

--HG--
extra : rebase_source : 0fbd664c8d6a8bf9cf2489534ac4ba794339db57
2017-10-13 16:49:43 +01:00
Andreas Tolfsen
a714eee6d4 Bug 1407990 - Drop contribution section in doc/Intro.md. r=maja_zf
Contribution information is covered by CONTRIBUTING.md.

DONTBUILD

MozReview-Commit-ID: 7MLBfFaFe7L

--HG--
extra : rebase_source : 8fe6ae96cfe634d73ada7d56df763124c70a43d9
2017-10-13 16:49:08 +01:00
Andreas Tolfsen
41f7b99123 Bug 1407990 - Move Marionette debugging docs in tree. r=maja_zf
This is a liberal rewrite of
https://developer.mozilla.org/en-US/docs/Marionette/Debugging.

DONTBUILD

MozReview-Commit-ID: 9RQozRIdIAy

--HG--
extra : rebase_source : ef91bd6819bdf429be563aba06cf51f6f9cc599e
2017-10-13 16:47:27 +01:00
Andreas Tolfsen
5369828fd7 Bug 1407990 - Import Marionette intro docs. r=maja_zf
This is an exact copy of
https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette.

DONTBUILD

MozReview-Commit-ID: BtM0UZogLrY

--HG--
extra : rebase_source : b56142db79d165b9053420530f4167c3d758873f
2017-10-12 14:31:09 +01:00
Andreas Tolfsen
cec379c8b6 Bug 1409037 - Bind this.resetValues after performing legacy action chain. r=whimboo
If the action chain fails it will cause a JS error because its
prototype will be wrong.

MozReview-Commit-ID: 6Wbjdw2KHNV

--HG--
extra : rebase_source : 5f57b525fc846bae3bc579a3d074c0f4d793c008
2017-10-05 13:01:23 +01:00
Andreas Tolfsen
7974848c51 Bug 1408454 - Move error.pprint to format.pprint. r=whimboo
Pretty-printing an object belongs more naturally to the new format module.

MozReview-Commit-ID: AfXLMPAT5ar

--HG--
extra : rebase_source : 1074febec66df49745256fc9cd04b0fecd293919
2017-10-13 17:59:30 +01:00
Andreas Tolfsen
5439883d3d Bug 1407985 - Add Marionette new contributor guide to docs. r=maja_zf
This is a conversion of
https://wiki.mozilla.org/User:Mjzffr/New_Contributors.

DONTBUILD

MozReview-Commit-ID: 4dLXr8zC3bN

--HG--
extra : rebase_source : ccf227644396f8f32485b5aa74cc9de6c7d0134b
2017-10-12 14:18:23 +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