Commit Graph

135 Commits

Author SHA1 Message Date
Cameron McCormack
234b89c117 Bug 1435666 - Part 3: Remove nsIDOMXPathResult. r=bz
MozReview-Commit-ID: 9j6dUlanNTi

--HG--
extra : rebase_source : 9a790516379441d4e048009bcacdd26e93fde6ae
2018-02-05 11:39:18 +08: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
44b2be2861 Bug 1430575 - Adjust editable definition to match WebDriver. r=automatedtester
Introduces a new function, isMutableFormControl, to the element
module in Marionette that tests if an element is a form control
that can be edited by the user.  This replaces the proprietary
UNEDITABLE_INPUTS set used previously.

An editable element is, according to the WebDriver standard, an
element which belongs to the two subcategories of editable elements.
This patch implements the first category of the mutable form controls.

MozReview-Commit-ID: Aix19mq3lcb

--HG--
extra : rebase_source : 1e3d671cd2d3ff618bf2fff3a2d8dadbd82d0540
2018-01-15 17:14:37 +00:00
Andreas Tolfsen
730854f761 Bug 1354211 - Add element.isEditingHost and element.isEditable. r=automatedtester
Introduces two new functions called element.isEditingHost, for
determining if an element is content-editable or part of a document
in design mode, and element.isEditable, which implements the
WebDriver-defined concept of what it means for an element to be editable.

WebDriver consideres an element editable if it is not read-only or
disabled, and one of the following conditions are met:

  - It is a <textarea> element.

  - It is an element that is not of the checkbox, radio, hidden,
    submit, button, or image types.

  - It is content-editable.

  - It belongs to a document in design mode.

MozReview-Commit-ID: 6U71uSUNwoI

--HG--
extra : rebase_source : c5702362d5be531b2e5b764fac13bb9db9f20f23
2017-12-31 14:52:46 +00:00
Andreas Tolfsen
e2bea6dd58 Bug 1354211 - Add element.isDisabled. r=automatedtester
Adds a new function called element.isDisabled to test for disabledness.
An element is only considered disabled if it is indeed an element
that can be disabled, for example that it is a <button>, <input>,
<select>, <textarea>, <optgroup>, or <option> element.  All other
elements are not disabled.

In nested trees the disabledness state of a containing element
affects child elements, without this being refelected in the child
element's content IDL attribute.  In the following example, the
<option> element is disabled:

	<select disabled>
	  <option>foo
	</select>

Similarly:

	<select>
		<optgroup disabled>
			<option>bar
		</optgroup>
	</select>

This means we have to traverse the tree to find the closest ancestral
parent element, whether it is <optgroup> or <select>, and inspect
its state before we can be sure the element in question is not disabled.

MozReview-Commit-ID: 578zLNj7nXK

--HG--
extra : rebase_source : fb8f4dc519a57a8fb4849a098f1e06f79aa02c9f
2017-12-31 14:48:46 +00:00
Andreas Tolfsen
20643a5532 Bug 1354211 - Add element.isReadOnly. r=automatedtester
Introduces new function for testing whether an element is read-only.
This content IDL attribute only applies to <input> and <textarea>
elements.

MozReview-Commit-ID: 1YLizKUYMU6

--HG--
extra : rebase_source : 2d7dcd34d20cf0dd2f0e0087b28e5eeebfa72fad
2017-12-31 14:44:02 +00:00
Andreas Tolfsen
d5a964bb11 Bug 1354211 - Use element.findClosest in element.getContainer. r=automatedtester
element.findClosest is a more generalised version of findAncestralElement,
which is limited to a list of element tag names.  By using
element.findClosest and CSS matching we also avoid a redundant iteration.

MozReview-Commit-ID: 32QwmkwiGf5

--HG--
extra : rebase_source : 5197971bd950cd0d90514a12bacb4642779a9090
2017-12-31 14:41:56 +00:00
Andreas Tolfsen
662639d9ba Bug 1354211 - Add element.findClosest for finding ancestor by CSS selector. r=automatedtester
Introduces a new function, element.findClosest, that finds the
closest parent node by a CSS selector expression.  This is useful to
find arbitrary elements in the tree above us and is quite possibly
reusable for element.getContainer.

MozReview-Commit-ID: 8rBEepmDdPm

--HG--
extra : rebase_source : 3055d23ce7aeba355de93fdeff52eb4ffdffbc24
2017-12-31 14:39:14 +00:00
Andreas Tolfsen
27edd882b6 Bug 1354211 - Consider <optgroup> when finding container element. r=automatedtester
It is a bug in element.getContainer that <optgroup> is not considered
when locating the containing context element, <select>.  <optgroup>
is also a child element of <select> on the same level as <option>.

MozReview-Commit-ID: 2GJJrRuY5Th

--HG--
extra : rebase_source : 2bfabe6f79bc0d6d473657ef34cded04c51857a3
2017-12-31 14:32:38 +00:00
Andreas Tolfsen
07e106bfb3 Bug 1429111 - Remove unused nsITimer from element.Store. r=maja_zf
There is an unused nsITimer instance in element.Store#timer that
this patch safely removes.

MozReview-Commit-ID: APvPsXfHUk9

--HG--
extra : rebase_source : f936abcb20d42c0eb27cfdee62d461d276cc2e5c
2018-01-09 16:29:13 +00:00
Andreas Tolfsen
82905af7f5 Bug 1424635 - Consider DOCUMENT_NODE a valid web element. r=automatedtester
When looking up the parent of <html> using an XPath parent expression
such as "..", the nodeType of the returned HTMLDocument will be 9
(DOCUMENT_NODE).  <html> is a valid web element and we should be
able to serialise and return it to the user.

It is worth noting that other WebDriver implementations fail this
test because they fail on the nodeType check.

MozReview-Commit-ID: 4FMJEd8B4PZ

--HG--
extra : rebase_source : 24e7cb9da64cde0f133a09781c595b23f919ed59
2017-12-14 12:14:56 -06: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
Henrik Skupin
f58fa132cb Bug 1406505 - Fix element.isInView to use table cells instead of rows. r=ato
As long as bug 1413493 has not been fixed the <tr> nodes will not be part
of the element tree. To workaround this problem we could use the first
found cell of the given row to check for visibility.

MozReview-Commit-ID: 57nuvxYrSMg

--HG--
extra : rebase_source : 8a27105bf3a0ff9d226869fe0fa6b70c89dc4c0e
2017-11-01 16:33:08 +01:00
Henrik Skupin
61e9302acf Bug 1406505 - Fix element.getContainer() to return button as container. r=ato
Because as long as bug 1089326 is not fixed child nodes of <button>
are not part of the element tree. As such the button has to be returned
as container for any of those nodes.

MozReview-Commit-ID: Jq6B9Kn7VAf

--HG--
extra : rebase_source : 8c89322d14b14bc1409f36de6cf897c2635a5603
2017-10-20 17:52:03 +02:00
Andreas Tolfsen
34669663f4 Bug 1410796 - Add nodeType existence check. r=whimboo
If the node variable is an object that is not null, and nodeType is
not an own property of it, node.nodeType === node.ELEMENT_NODE might be
evaluated as undefined === undefined if ELEMENT_NODE is also missing.
This will pass the condition, which is an unintended consequence.

To remedy this, we first check that nodeType indeed exists on node
before proceding.

MozReview-Commit-ID: G0eaRvwm5mv

--HG--
extra : rebase_source : 8c08e0363f26095cf672d2b11699431b1fb4ef9f
2017-10-31 19:59:41 +00:00
Andreas Tolfsen
e944eb5cdb Bug 1410796 - Drop element.isSVGElement. r=whimboo
This drops the now-superfluous element.isSVGElement.  SVG elements
are matched with element.isDOMElement because there is no special
need to distinguish them from other elements, apart from chrome elements.

MozReview-Commit-ID: 3AgEtyaAsPU

--HG--
extra : rebase_source : 7ec52aa9a7b7404eff5b6daf8ebe8259f06265da
2017-10-31 19:57:40 +00:00
Andreas Tolfsen
b91e906a0c Bug 1410796 - element.isDOMElement to match any non-XUL element. r=whimboo
This patch makes element.isDOMElement match any non-XUL element,
meaning it will henceforth match both SVG elements as well as any
custom XML namespaced element.

In the bug 1410796, Marionette does find the element, but is unable
to add it to the known web element store.  This is a result of the
changes made in bug 1400256, where I introduced a set of functions
for element type recognition needed for determining which web
element abstraction to use for an element.

We use element.isDOMElement to distinguish content elements from chrome
elements, and this change consequently makes element.isSVGElement
superfluous.

MozReview-Commit-ID: AkEHm6zroKz

--HG--
extra : rebase_source : c6f101e12839241f60c8c1b3908df3a3e4a89a51
2017-10-31 19:55:49 +00:00
Andreas Tolfsen
089e754126 Bug 1410652 - Use invalid argument error for web element deserialisation. r=whimboo
For user input we will want to return the appropriate invalid
argument error.  For internal input using TypeError is fine.

MozReview-Commit-ID: AlOnZuhaczN

--HG--
extra : rebase_source : f16aa13b6fc53da6261594dab0c9df34d6c3df6e
2017-10-24 17:42:32 +01:00
Andreas Tolfsen
f9a44482f3 Bug 1410652 - Fix various API documentation in element module. r=whimboo
MozReview-Commit-ID: AaGnolglX5n

--HG--
extra : rebase_source : 5fccbd53ab96849df2aece2679db2df84aced804
2017-10-24 17:38:55 +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
8cd7e47451 Bug 1411307 - Return iterators for element retrieval. r=whimboo
These functions currently return sequences or arrays of elements, which
wastes cycles and memory because we spend time constructing these data
collections in cases where we only need the first element.  This is
the case for WebDriver:FindElement and WebDriver:FindElementFromElement.

This patch changes the Marionette element retrieval functions to
consistently provide iterators instead of sequences when looking
up elements.  Making them generator functions means the iterable
can be expanded using [...iterable] when necessary.

MozReview-Commit-ID: FZbKLuRWqgA

--HG--
extra : rebase_source : 1e7dc8c614004444f8b2476cb1a136ed36943374
2017-10-24 16:51:38 +01:00
Andreas Tolfsen
d15a90317a Bug 1410652 - Use invalid argument error for web element deserialisation. r=whimboo
For user input we will want to return the appropriate invalid
argument error.  For internal input using TypeError is fine.

MozReview-Commit-ID: AlOnZuhaczN

--HG--
extra : rebase_source : 57992fc62c08736cb24f7ee229a4c8930751e068
2017-10-24 17:42:32 +01:00
Andreas Tolfsen
4b10cb69dd Bug 1410652 - Fix various API documentation in element module. r=whimboo
MozReview-Commit-ID: AaGnolglX5n

--HG--
extra : rebase_source : de1c338530fbbb68f695c2af8de53a9fe9c1c8e0
2017-10-24 17:38:55 +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
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
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
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
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
545d5ec9f4 Bug 1275273 - Make WebDriver:IsElementSelected conform to spec. r=maja_zf
Splits interaction.isElementSelected into two parts: one checking
whether the element DOM properties are selected/checked, and the
other checking accessibility.  This so this so that the selectedness
can be unit tested, as we do not have the capability of standing
up accessibility in the xpcshell tests.

The second part of this change moves us away from atom.isElementSelected
in favour of a specification conforming implementation in Marionette.
This is a word-by-word implementation of the Is Element Selected
command from WebDriver.

MozReview-Commit-ID: 93WDKbPcEIB
2017-10-11 15:24:03 +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
74fbed7467 Bug 1404946 - Have PollPromise accept an options dictionary. r=whimboo
This patch moves the "timeout" and "interval" positional arguments
on PollPromise to an options dictionary.

In the following code example it is hard to know which argument means
what because they are not named:

	new PollPromise(resolve => resolve(), 100, 100);

Named arguments can be achieved in JavaScript using option
dictionaries, and this patch changes the input PollPromise takes so
that the above example looks like this:

	new PollPromise(resolve => resolve(), {timeout: 100, interval: 100};

This plays especially well with code in testing/marionette/element.js
as we already have named arguments that we can pass directly in through
an object literal, making the code more readable and more compact:

	let timeout = 42;
	new PollPromise(resolve => resolve(), {timeout});

MozReview-Commit-ID: GFWNGQAeWk1

--HG--
extra : rebase_source : 296843053e72bd07463a3018b06782f0dcc4828a
2017-10-02 17:13: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