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
As part of the focussing steps we subsequently need to blur the
element after a focus.
MozReview-Commit-ID: xyCcmqeOpO
--HG--
extra : rebase_source : 6645d354841a67730f2cfd89f59af390bb19691e
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
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
This marks **/docs/** as exclusively docs, and code that is autodoc'd as
inclusively docs.
That means that a change that purely modifies documentation files will *only*
run `docs` tasks, while a change that modifies autodoc'd source code will
*additionaly* run `docs` tasks. The tasks do not run by default.
MozReview-Commit-ID: G9tOK0AwtrI
--HG--
extra : rebase_source : 8dd971e5c9b0eb5f47895664a4ea49442f303ecb
extra : source : 0881de9b2b5e36ec37cc866f1d4af109da57a919
There is an unused nsITimer instance in element.Store#timer that
this patch safely removes.
MozReview-Commit-ID: APvPsXfHUk9
--HG--
extra : rebase_source : f936abcb20d42c0eb27cfdee62d461d276cc2e5c
There is no functional purpose of this patch apart from laying
groundwork to make the window tracking patches easier to review.
MozReview-Commit-ID: GOIysDLVWIf
--HG--
extra : rebase_source : b7ddbd91fa3bc53f30552a7a4761bbf7e9efda1b
By calling "delete_session" the currently used session id always has to be reset,
because each session has its own unique id.
MozReview-Commit-ID: H9RiuNj7fRd
--HG--
extra : rebase_source : 13ca1cf1c80d74024fce5323f9d91b12fd8b5ad2
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
It is easier to review what message listeners are added and removed
when the list is sorted.
MozReview-Commit-ID: 2fMpulA42Ww
--HG--
extra : rebase_source : 64e80f7c314596f27400657bd2e77da110f1443e
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
When WebDriver:ElementClick clicks an <option disabled> element,
its selectedness state should according to a new specification
change proposed not change:
https://github.com/w3c/webdriver/pull/1189
This patch provides tests for the specification change.
MozReview-Commit-ID: EXG98LjgB7d
--HG--
extra : rebase_source : d9e5b31dbd869c8151d85eb2b5bb8ba94a378a52
For parent process crashes a Wait().until() condition was added, which is
not necessary because if the parent (chrome) process dies, the browser
window will be gone immediately, and the IOError is thrown directly.
Further the tests should check that the correct type of crash is shown
in the IOError exceptions.
MozReview-Commit-ID: JC90CObZQ3r
--HG--
extra : rebase_source : 050fea4217c9ad95a84e20b6d5d92b42a89c3521
The uuid-generator is not always used when the proxy module is imported.
This changes it to be lazily loaded so we do not always initialise it.
MozReview-Commit-ID: In0oAGDFjWy
--HG--
extra : rebase_source : d4d6c594cd1ac0872a1f34a30f3e7452a7759300
The SyncChromeSender class and its factory construction function
proxy.toChrome is not used in Marionette and can be safely removed.
MozReview-Commit-ID: jBJ0nIkn3i
--HG--
extra : rebase_source : 83d9c8261eafc9385d8edee913cc0fdfed48dcaa
The AsyncChromeSender and its factory construction function
proxy.toChromeAsync are no longer in use.
MozReview-Commit-ID: 8tFr1IUTd5g
--HG--
extra : rebase_source : 0ade57fd83aa7d38b93f22cc87952e004902995d
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
The clean-up code in FennecInstance now counts and logs consecutive DMErrors.
The Marionette clean-up code then throws an UnresponsiveInstanceException
if we hit consecutive errors more than twice, which interrupts the
test run entirely. (Previously, MarionetteTestRunner would just keep running
tests despite consecutive clean-up failures, and eventually it would time out.)
This change allows us to take advantage of the retry mechanism in the
mozharness script that runs all Android tests: it sets the job status to "retry"
if it finds DMError in the test log after the run_tests step is done.
MozReview-Commit-ID: J36XuFVK1aK
--HG--
extra : rebase_source : 99914fd768522fe45160f171966a5efc65c59cc2
There are many gotchas to be aware of when working on Marionette
source code. It would be a good idea to collect this in a single
document that could serve as documentation in onboarding new
developers.
DONTBUILD
MozReview-Commit-ID: DuVqckA7wLP
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
In order for |mach test| and |mach mochitest| to log an overall summary,
every test harness invocation they make needs to use the same structured
logger (otherwise the affected suite will be missing from the summary).
MozReview-Commit-ID: 8LJw7r8SItk
--HG--
extra : rebase_source : 1417dce3817bae94ad61a5250065c6cbc35857e4
Suite names are currently only used by formatters to print out
an overall summary from |mach test| and |mach mochitest|. So
this doesn't need to be exact and can be tweaked further at a
later date.
If multiple test invocations have the same suite name, their
results will be merged in the overall summary. If a suite name
is missing, the summary will contain a placeholder name.
MozReview-Commit-ID: K1xpb9hUQRX
--HG--
extra : rebase_source : cc8cc8b36255d939dd5dffd3c5444c34951ac8e2
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
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
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
The IPC message "aliveCheck" will always fail because there is no such
message handler in Marionette and because it swallows all thrown errors.
MozReview-Commit-ID: JISuK65ZcGM
--HG--
extra : rebase_source : e4ccbb96727a67ce11f31463a08f66768bd23589
The MarionetteFrame:getCurrentFrameId IPC message was used for B2G
applications that needed access to chrome-scoped APIs for emitting
touch events. Now that actions happen either in chrome _or_ in
content this is no longer necessary functionality to maintain.
MozReview-Commit-ID: Bk9LRAOxjAw
--HG--
extra : rebase_source : 71dac090db681a24dc5ebb54fdf1cf02a97563b0
MarionetteFrame:getInterruptedState was used in B2G to abortence
if the OOP frame got interrupted by a modal dialogue. Like the
MarionetteFrame:handleModal IPC message, the frame script needed
chrome assistance for querying the presence of this dialogue.
Today modal dialogues (known as "user prompts") are handled entirely
in chrome space, and the presence of such a dialogue is indeed
meant to pause script execution in the web document.
This patch makes some rather questionable changes to the legacyaction
module, but this is alright because we don't expect any more tests to
be written using it. This patch just about makes sure the remaining
body of tests keeps passing.
MozReview-Commit-ID: 72g0GlYy21T
--HG--
extra : rebase_source : f44ed5999554a42c67827d6935bd96cc79a8e5dd
The MarionetteFrame:handleModal IPC message is not used in listener.js,
and it is no longer a requirement that this is done through a call
from the content frame script.
MozReview-Commit-ID: Bn40b1VT7Da
--HG--
extra : rebase_source : 9def3f7faa5f860622259bd85982e1072b436be0
The Marionette:shareData IPC message was used by the simpletest
harness to share test logs with the main process. This is no longer
a requirement.
MozReview-Commit-ID: 4nn7FefCdJ8
--HG--
extra : rebase_source : 44d8334c4a116d7056ee7a938fdf900e350d73f2
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
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
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