With newer Selenium atoms which do not conflate attributes and
properties, the retrieval via getElementAttribute will fail. By
retrieving it directly as property will fix it.
MozReview-Commit-ID: CFy3JZDeUWq
--HG--
extra : rebase_source : ed3a358f52b7cd54f3c5dda037fddaa93173e3b6
When verifying error messages, the second parameter of Assert.throws has
to be a regular expression.
MozReview-Commit-ID: LJ6Iif8ORTs
--HG--
extra : rebase_source : 0cbe9f31880df44f9c822d8410ab4571281c17ef
Search suggestions create unneccessary network requests and the suggestions
opt-in notification interferes with tests that don't expect it to be there.
So, this patch updates the default settings in Marionette to disable both.
MozReview-Commit-ID: 8X8SYPq19tj
--HG--
extra : rebase_source : cd0fe8f3437340b1266d161e1cad46bcbcd1a6f6
The wrapper puppeteer.platform in Firefox UI test was deemed redundant.
MozReview-Commit-ID: LUocC59bLNF
--HG--
extra : rebase_source : e764ba1d09d3f752e75ec6aed80ca93781c319dc
This switches to using a timeout of 120s * timeout_multplier, which is
twice the current value. The Marionette startup_timout value is
removed because it turns out that's only used when marionette starts
the Firefox instance and therefore is ignored in this case.
MozReview-Commit-ID: 4VA8yB6M1d5
--HG--
extra : rebase_source : ba9d506d4061d49f2a95fbb24e690841fc902c97
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
This makes it possible to subscribe to DOM events in web content, in
order to facilitate fixes for cases such as https://bugzil.la/1397007.
Although the current interface, WebElementEventTarget, is associated with
browser.Context (curBrowser) it is the intention that we in the future
will associate this with representations of the marshaled web element.
This will make it quack and act like an Element's EventTarget, which
has nice parity to it.
The WebElementEventTarget works by passing IPC messages to
a backend service in the content frame script implemented by
ContentEventObserverService. This registers event handlers for specific
DOM events, and relays these events back to the browser-specific message
handler in chrome.
This will enable chrome code to wait for events to occur in content,
like this:
await new Promise(resolve => {
webElement.addEventListener("visibilitychange", resolve, {once: true});
contentBrowser.minimize();
});
MozReview-Commit-ID: B8MMHyG8n04
--HG--
extra : rebase_source : 25ac77fbcfb09435325719ac61614c4a8ce37996
On Windows TaskCluster workers Marionette could be ready within 1s.
As such the currently used timeout is too long, and needs to be
further reduced.
MozReview-Commit-ID: KbLVdpB71cu
--HG--
extra : rebase_source : 2b9139e4b7e2c9d5815e7cc481086ca779385538
Shield experiments interfer with core features of Firefox which can
cause tests run via Marionette or geckodriver to fail. Resetting the
API URL will make sure that no experiments can be downloaded.
MozReview-Commit-ID: HnE49jfnen7
--HG--
extra : rebase_source : 2fa6cf86ddce798eba88a41d227768f149cccc70
Shield experiments interfer with core features of Firefox which can
cause tests run via Marionette or geckodriver to fail. Resetting the
API URL will make sure that no experiments can be downloaded.
MozReview-Commit-ID: HnE49jfnen7
--HG--
extra : rebase_source : 9cec29085032318e9e8467d6d754afe0890ae645
When the binary gets launched we do not immediately kill the process if the
connection to Marionette server cannot be established within the given amount
of seconds. Instead "_handle_socket_failure" is getting called because
the utility method `raise_for_port` inappropriately uses the `@do_process_check`
decorator.
By removing the decorator the initial connection attempt can be handled
differently. As such the process if handled by Marionette will be immediately
killed. Currently we are waiting for the process to quit itself within 120s,
which will actually never happen due to no active session.
Further `start_session` defaults to a timeout of 60s which itself is problematic
for test harnesses using Marionette but controlling the binary themselves. In
those cases timeouts can happen often for slow starting browser processes like
debug builds. Instead this timeout should default to the `startup_timeout` value.
MozReview-Commit-ID: BZvX5KT45mK
--HG--
extra : rebase_source : 875807b75f0575a10dc9de3588237002fa6a5821
Take into account that a weak referenced element might have been destroyed
in the element staleness check.
An error is thrown when the reference object has been destroyed when
getting a weakrefs' pointer. We catch this, but element.isStale does
not take into account that the el argument in this case can be null,
or in this revision of the patch, undefined.
MozReview-Commit-ID: 7sr4YGhAotS
--HG--
extra : rebase_source : 995eeef4ec1b19bf100cb95c4dd343e947b1cf52
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
This tests both that the settings have the desired effect and that switching
between sharing enabled and sharing disabled without a startup cache flush
does not cause any issues.
Tests for user pref changes are currently non-fatal, since they're known not
to work reliably.
MozReview-Commit-ID: 1ZFwyiNf3da
--HG--
extra : rebase_source : c38bd92d2137c90f8c4d202b7009612b45ff4be9
Currently defaults for startup_timeout and socket_timeout are defined
at two different places (Marionette driver and harness). As of now it's
even the case that startup_timeout has different values. While Marionette
driver uses 120s, the harness only uses 60s.
As result all jobs which are based on the Marionette harness fail if
Firefox starts-up slowly like for debug builds.
MozReview-Commit-ID: Dl4sBG1H7NA
--HG--
extra : rebase_source : 959facabebc371beee23b4de345ddd2495913bb7
Currently defaults for startup_timeout and socket_timeout are defined
at two different places (Marionette driver and harness). As of now it's
even the case that startup_timeout has different values. While Marionette
driver uses 120s, the harness only uses 60s.
As result all jobs which are based on the Marionette harness fail if
Firefox starts-up slowly like for debug builds.
MozReview-Commit-ID: Dl4sBG1H7NA
--HG--
extra : rebase_source : 688338b1782deaf08eb01c7c5d4ca01ba03328f5
To allow resetting the default no proxy exclusion entries in
Firefox tests have to pass an empty noProxy list. This should
also be correctly applied.
MozReview-Commit-ID: ABmYdPvoSvx
--HG--
extra : rebase_source : 313fe0a918a4a9bfe5204e5777568ee5f89744d3
If Marionette client cannot connect to the server, the attempts
have to be logged to stderr. This allows us to inspect the reason
why a connection from the client could not be made, and that it
still tries to connect (see bug 1362293).
MozReview-Commit-ID: ElE1M73ums8
--HG--
extra : rebase_source : e64a549e98b0adc4e7ea410f0d2fd500e0d55f87
Currently the listener for addon installs misses a check for the addon id,
to only resolve the promise when it has been called for the expected addon.
This can cause race-conditions if other addons are getting installed at the
same time.
The same applies to uninstall which doesn't wait at all until the operation
has been completed.
MozReview-Commit-ID: 5GsomMoAVZ1
--HG--
extra : rebase_source : a1b43adb2239b0c28cbee1d843f4b6c666a07f0a
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
HTML elements' ownerGlobal is a WindowProxy that indirects operations
to the current browsing context. However, for XUL elements this global
is ChromeWindow which gets reset to null when the window is discarded.
For the same reason, since win indirects to the current browsing context's
associated window, we need to test that the element's node document is
not the active document.
Finally test that its shadow-including root is a document.
MozReview-Commit-ID: EYh18P8DbcN
This patch introduces a new error.stack function as a shorthand for
creating stacktraces. It is equivalent to calling
new Error().stack
and removing the first line of the stack. Removing the first line is
needed to make it appear as if the error originated from the caller's
position in the program.
MozReview-Commit-ID: DpSSWU5vPDm
--HG--
extra : rebase_source : 52697e348367b2b7dbeb28a711a9bd1fdef076ec
pprint is currently exposed twice: once on the error namespace and once
separately. We only want to expose it once, and since there are only a
handful "error.pprint" usages left, we can go ahead and make this change.
When we move transition to use "require" in the future, like devtools
does, it will be possible to use both "error.pprint" and "pprint" styles
without export duplication.
MozReview-Commit-ID: CAnPDWn9Vr7
--HG--
extra : rebase_source : 05a05460d710eb96fa7b20cb94477be0282809de
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
In the spec the socksProxyVersion key has been renamed to
socksVersion. Marionette has to be adjusted for this change.
MozReview-Commit-ID: Ep3zNZLKxXl
--HG--
extra : rebase_source : f29f45c9d30fa5f208b595f2e90f544ab652c8cc
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
This allows .flake8 files to override one another, and fixes a pretty bad known
bug with our flake8 implementation. For example, say we have a .flake8 file at:
/foo/.flake8
Before this patch, if we ran |mach lint foo/bar|, the configuration defined in
that .flake8 file wouldn't get picked up. It would only work if running the
specific directory that contains it, e.g |mach lint foo|.
This change additionally allows multiple .flake8 files to be used. So if
there's one defined at both:
/.flake8
/foo/.flake8
Then running |mach lint foo/bar| will first apply the root .flake8, then the
one under /foo (overriding earlier configuration).
This bug still doesn't make flake8 configuration perfect though. Any directory
containing a .flake8 file still needs to be explicitly listed in the "include"
section of /tools/lint/flake8.yml. Otherwise in the example above, if running
|mach lint /|, it wouldn't be able to find /foo/.flake8. This is a hard problem
and is likely best solved by fixing flake8's upstream configuration handling.
Unfortunately this means we still can't switch from a whitelist to a blacklist.
MozReview-Commit-ID: 3DZAi1QHYYo
--HG--
extra : rebase_source : 51298c5847f6c2792581d9b312c87b70fa716ee1
A fallout from https://bugzil.la/1392346 was that element.isStale called
element.isDisconnected incorrectly by using the old container object.
This was reported in https://bugzil.la/1392854.
Since we in the long term want to get rid of the concept
of window/shadow root containers (in preparation for
https://bugzil.la/marionette-window-tracking), we might as well fix
the fallout by making element.isDisconnected take separate window-
and shadowRoot arguments, like element.isStale.
Fixes: https://bugzil.la/1392854
MozReview-Commit-ID: ELIu8HsZUfK
--HG--
extra : rebase_source : 3f0cc83048d9f069c47c08c0a6d886033c106825
The background thread hang monitor will crash Firefox after 60s if
a shutdown is too slow. Debug builds are slower and as such Marionette
would force kill Firefox right before the hang monitor can kick in.
MozReview-Commit-ID: GGQFPEZ37dg
--HG--
extra : rebase_source : 99223b83c60be1abad1cc23d8a7c9c31a9f39379
The convention is to use fromJSON (instead of fromJson) because this
gives parity to toJSON which is supported by JSON.stringify.
MozReview-Commit-ID: 9dX14pFO2Bj
--HG--
extra : rebase_source : d0c1d657eee1f84d34e5a7116d8bb9ca579c8b51
Since these tests harnesses are already disabling Safe Browsing and tracking
protection, they should also disable the other two features that cause
lists to be downloaded from the Mozilla shavar server.
MozReview-Commit-ID: 2158qRU4XZx
--HG--
extra : rebase_source : 287bfb7580538cca7f58ab035b7141166346c318
The FrameLoaderOwner interface has been implemented in WebIDL for several
years now, so these QIs are simply unnecessary overhead.
MozReview-Commit-ID: LAzvfm5Qhy0
--HG--
extra : rebase_source : 2495c07df21c474f5fabc257ff4db43b0d8047e4
The login reputation checks depend on a server lookup and therefore would
render non-deterministic the performance and correctness of tests.
MozReview-Commit-ID: Bil0rSZsGPT
--HG--
extra : rebase_source : ae06a028c71eee323307ecd4e62bbf1e8a14fe13
The login reputation checks depend on a server lookup and therefore would
render non-deterministic the performance and correctness of tests.
MozReview-Commit-ID: Bil0rSZsGPT
--HG--
extra : rebase_source : c9a641e4bf49c48bf864ed546bf2ae6eb51c27e4
In preparation for a larger window tracking change to Marionette, we
want to decouple the element staleness check from the element.Store.
MozReview-Commit-ID: JNZqCc2eZqy
--HG--
extra : rebase_source : a21344ef9ecc01523545b2f866fbb5415afcedb3
In certain places, the Marionette action module calls error.pprint as
if it is a function. pprint is a ES6 string template and should be used
like pprint`${replacement}`.
MozReview-Commit-ID: 29UoCNxkKa7
--HG--
extra : rebase_source : f8fe408827353f78ee223175316d5b5f9b6a8df5
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
Various functions in the action module take a container object such as
{frame: <WindowProxy global>, shadowRoot: <Element>}
when it in fact never uses the shadowRoot entry. As part of the new
window tracking we will get rid of the container concept altogether.
Because the action module is sufficiently self-contained, we can start
with removing it from there already.
MozReview-Commit-ID: KeeNF08mqnX
--HG--
extra : rebase_source : 51eee50a648a994fab456adf4add46c91a6c82a3
The other window state manipulation commands are named minimizeWindow
and maximizeWindow.
MozReview-Commit-ID: IBVqJSRwG8x
--HG--
extra : rebase_source : a1efaf7cf2a5c068b62c60453b1f8814d34b043b
The other window state manipulation commands are named minimizeWindow
and maximizeWindow.
MozReview-Commit-ID: IBVqJSRwG8x
--HG--
extra : rebase_source : 29271a475a847ca15c1d8f736520b238c0818791
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
The Firefox remote protocol in testing/marionette predominantly uses
camel casing in naming properties and variables. To enforce consistency
with this practice, this patch adds an eslint rule to enforce camel case.
There are a few exceptions where we use snake case in response output.
We can disable the lint rule on an individual basis in this handful
of cases.
MozReview-Commit-ID: DL7msdriFil
--HG--
extra : rebase_source : 737791b59002027f7501e7c46bd31d7a368a9b66
We recently had a serious bug in Marionette (https://bugzil.la/1254136)
due to a case statement that fell through due to a missing "break"
statement. This patch introduces a lint rule to prevent similar episodes
in the future.
When you do want a case to fall through, it is possible to add a comment
like this:
switch (foo) {
case 1:
doSomething();
// fall through
case 2:
doSomething();
break;
}
MozReview-Commit-ID: Gu8cFGsdne2
--HG--
extra : rebase_source : 8b29c663167783770d0eb0a32b7a7c2cb83a529e
This switches most tests over to use pytest as the runner instead of unittest (taking
advantage of the fact that pytest can run unittest based tests).
There were a couple tests that had failures when swithing to pytest:
config/tests/unit-expandlibs.py
xpcom/idl-parser/xpidl/runtests.py
For these tests, I added a runwith='unittest' argument so that they still run the
same way as before. Once we fix them to use pytest, the unittest logic in mozunit.py
can be deleted.
MozReview-Commit-ID: Gcsz6z8MeOi
--HG--
extra : rebase_source : 3c762422ce0af54cbbe7d9fc20085a2d1ebe7057
A missing break statement caused a double execution of the code in
"profile-after-change", which leads to two instantiations of the
Marionette server colliding due to the same port.
MozReview-Commit-ID: Dp6fncj463j
--HG--
extra : rebase_source : dd4301c2fb797da228c0011e6bd90afa9171fb54
The webdriver spec declares the "proxyType" as required, and of
type string.
MozReview-Commit-ID: FXUhdYfOwWI
--HG--
extra : rebase_source : dc069a4de1e014951ed430bf5448ca0e3ac2545e
The "mach marionette doc" command to generate Marionette server API
documentation should exit with jsdoc's return code so the caller can
determine whether the operation was successful.
MozReview-Commit-ID: BXqGQlN5WPN
--HG--
extra : rebase_source : d7a45f321fe7f7c455d905b6cb90549872f2059d
The webdriver spec has been updated a while ago and renamed the proxyType
for not using a proxy from "noProxy" to "direct".
MozReview-Commit-ID: FjDIK8XCba8
--HG--
extra : rebase_source : 423149d3f82cf1b7e28d29a775359ac66e7a6f90
To allow geckodriver to create file objects in child processes, this
preference has to be set to true. As such it needs to be recommended
in Marionette and set as default preference for geckodriver.
MozReview-Commit-ID: 8bdbi5jH6Vc
--HG--
extra : rebase_source : cc8963d2b15357b6d1607854e978aa764fcbd42f
The webdriver spec has been updated a while ago and renamed the proxyType
for not using a proxy from "noProxy" to "direct".
MozReview-Commit-ID: FjDIK8XCba8
--HG--
extra : rebase_source : ab41d737c9ba06c8883bfd36839807e6c3316c92