The 250ms are too short given that the call to any console API could be
delayed due to IPC communication. As such use the default timeout
value as done by all the other tests that are using the events
recorder.
Differential Revision: https://phabricator.services.mozilla.com/D99657
Calling `npm ci` instead of `npm install` generates a reproducible
node_modules directory based on the entries in Puppeteer's `package-lock.json`
The most-recent Puppeteer sync (Bug 1670286) commits package-lock.json
to mozilla-central for the first time.
Differential Revision: https://phabricator.services.mozilla.com/D97811
This method only is async in order to allow callers to wait for a process switch
triggered by the call to `loadURI` to be finished before resolving. With
DocumentChannel, we should never trigger a process switch eagerly like this
again, so we don't need any of the async behaviour here anymore.
This part is largely mechanical changes to tests, removing the `await` calls on
`loadURI`, and a follow-up part will remove the actual async logic from
`BrowserTestUtils.loadURI`.
Differential Revision: https://phabricator.services.mozilla.com/D94641
To allow other components in Firefox to easily find the address
under which the Remote Agent is accessible, add the host and port
information as "debuggerAddress" to the Remote Agent's interface
definition.
Differential Revision: https://phabricator.services.mozilla.com/D96008
To allow other components in Firefox to easily find the address
under which the Remote Agent is accessible, add the host and port
information as "debuggerAddress" to the Remote Agent's interface
definition.
Differential Revision: https://phabricator.services.mozilla.com/D96008
This method only is async in order to allow callers to wait for a process switch
triggered by the call to `loadURI` to be finished before resolving. With
DocumentChannel, we should never trigger a process switch eagerly like this
again, so we don't need any of the async behaviour here anymore.
This part is largely mechanical changes to tests, removing the `await` calls on
`loadURI`, and a follow-up part will remove the actual async logic from
`BrowserTestUtils.loadURI`.
Differential Revision: https://phabricator.services.mozilla.com/D94641
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.
5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.
5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
We originally set 15s to keep the overall job duration under 30 minutes.
Since then, we hit timeouts much less frequently and should be able to
afford a longer timeout. The Puppeteer project's default test timeout
is currently 25 seconds.
Also skipping a Page test due to an async Firefox-specific protocol
error that interferes with teardown.
Differential Revision: https://phabricator.services.mozilla.com/D94245
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
Using different names for enabling the remote agent via
--remote-debugger and --remote-debugging-port adds confusion
to users. Also given that --remote-debugging is actually
not used by any client library including Puppeteer,
it can be removed.
Using --remote-debugging-port instead will bring us onpar
with Chrome and how it enables CDP.
Differential Revision: https://phabricator.services.mozilla.com/D92603
Before Quantum, we needed resizer icon on Windows, because when the
add-on statusbar was hidden, we could not resize the window. This is not
needed anymore and is dead code. Consequentially, this also helps reduce
unused images loaded at startup time.
Differential Revision: https://phabricator.services.mozilla.com/D91196
A session is defined as string in CDP but target specific commands
and events currently return a number based on the last used index.
This also makes it very easy to discover active sessions.
Differential Revision: https://phabricator.services.mozilla.com/D89352
It has some properties which make it footgunny, especially in the face of
Fission. Callers should use WindowGlobalChild.innerWindowId instead.
Differential Revision: https://phabricator.services.mozilla.com/D82801
Today we don't require that `mach` `CommandProvider`s subclass from any particular parent class and we're very lax about the requirements they must meet. While that's convenient in certain circumstances, it has some unfortunate implications for feature development.
Today the only requirements that we have for `CommandProvider`s are that they have an `__init__()` method that takes either 1 or 2 arguments, the second of which must be called `context` and is populated with the `mach` `CommandContext`. Again, while this flexibility is occasionally convenient, it is limiting. As we add features to `mach`, having a better idea what the shape of our `CommandProvider`s are and how we can instantiate them and use them is increasingly important, and this gives us additional control when having `mach` configure `CommandProvider`s based on data that is only available at the `mach` level. In particular, we plan to leverage this in bugs 985141 and 1654074.
Here we add validation to the `CommandProvider` decorator to ensure all classes inherit from `MachCommandBase`, update all `CommandProvider`s in-tree to inherit from `MachCommandBase`, and update source and test code accordingly.
Follow-up work: we now require (de facto) that the `context` be populated with a `topdir` attribute by the `populate_context_handler` function, since instantiating the `MachCommandBase` requires a `topdir` be provided. This is fine for now in the interest of keeping this patch reasonably sized, but some additional refactoring could make this cleaner.
Differential Revision: https://phabricator.services.mozilla.com/D86255
It has some properties which make it footgunny, especially in the face of
Fission. Callers should use WindowGlobalChild.innerWindowId instead.
Differential Revision: https://phabricator.services.mozilla.com/D82801
It has some properties which make it footgunny, especially in the face of
Fission. Callers should use WindowGlobalChild.innerWindowId instead.
Differential Revision: https://phabricator.services.mozilla.com/D82801
This also fixes a hang in Puppeteer's DOMWorld.js when resolving
the current executionContext promise. With the extra event all
the Puppeteer internal contexts for the tab target have been destroyed.
Differential Revision: https://phabricator.services.mozilla.com/D79450
IMPACTED_TESTS was added in bug 1184405, but is under-utilized in current moz.build
annotations; also bug 1516847 removed use of IMPACTED_TESTS in 'mach test'. This
patch removes remaining support for IMPACTED_TESTS.
Differential Revision: https://phabricator.services.mozilla.com/D79141
The architecture of `mach` does not make this easy to do from within one process, not least of all due to persistent global, mutable state. :( There may be another way to do this, I'm not saying it's completely impossible (and obviously with a significant enough refactor there's a way to make this happen), but subprocessing is a foolproof way to accomplish the same.
Differential Revision: https://phabricator.services.mozilla.com/D77374
On Ubuntu 18.04 tests are failing more often for debug builds
due to not received events. By using a timeout multiplier of
4 will give the events enough time to be recorded.
Differential Revision: https://phabricator.services.mozilla.com/D76992
Change the returned documentURL to be that of the requested document.
Ensure the return frameId is only returned if available, since it's optional.
Move some common steps into NetworkObserver for later reuse by other Network
events.
Differential Revision: https://phabricator.services.mozilla.com/D74578
With this patch both events will be emitted when sub frames are
loaded or destroyed.
Because more work is necessary before we can enable general frame
support in Remote Protocol all the code has been put behind the
preference "remote.frames.enabled'. Only if it's true (which is
not the default) the events are emitted.
Differential Revision: https://phabricator.services.mozilla.com/D74635
Domains would have created their own instance of the context observer,
which results in duplicated event listeners and observer notifications
to be registered.
This is still not ideal for the observer notifications, which should be
registered only once, but still an improvement for now. Bug 1635568 will
finally fix that.
Differential Revision: https://phabricator.services.mozilla.com/D74632
This behavior is in line with what Chrome does and correctly
describes the CDP version Firefox is (attempting to be)
implementing.
DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D75112
Implements the Chrome Devtools Protocol (CDP) command
Network.emulateNetworkConditions partially. At the moment,
only "offline" is emulated, all other arguments are ignored.
Differential Revision: https://phabricator.services.mozilla.com/D73211
With full color management enabled in bug 455077, generated
screenshots will not be saved as sRGB when the display has
a different ICC profile. As long as bug 1615395 hasn't been
fixed, force screenshots to be saved as sRGB.
Differential Revision: https://phabricator.services.mozilla.com/D74007
With full color management enabled in bug 455077, generated
screenshots will not be saved as sRGB when the display has
a different ICC profile. As long as bug 1615395 hasn't been
fixed, force screenshots to be saved as sRGB.
Differential Revision: https://phabricator.services.mozilla.com/D74007
The "this" state is not persistent across spawn-calls, using "this" in
"function" also does not make a whole lot of sense.
In order to persist the Promise across spawn-calls, the value is stored
in "content" instead.
Since one cannot reliably return an Event from SpecialPowers.spawn (due
to serialization issues), we are awaiting them instead of returning.
Differential Revision: https://phabricator.services.mozilla.com/D73913
This fixes exceptions hit in destructors when the browsing context
is null. We encounter this when navigating to file: urls, for example,
in which case the target doesn't have a browsing context id.
Differential Revision: https://phabricator.services.mozilla.com/D73459
The WindowObserver class is only used by the TabObserver, and as such
can easily be integrated transparently. This also removes the extra
events as being emitted for opening and closing XUL windows.
Differential Revision: https://phabricator.services.mozilla.com/D73044
The changes align our code to other instances of nsIWindowMediatorListener
usage in-tree, which always rely on the "load" event. Also "interactive"
isn't a ready state a XULWindow can ever be in, it's only used for content
windows.
Differential Revision: https://phabricator.services.mozilla.com/D73043
To better keep track of available observer classes
it's better to have them all in the same folder.
While moving files around the patch also renames
the TabObserver module to TargetObserver, which
would allow us to add target observers for workers
in the future.
Differential Revision: https://phabricator.services.mozilla.com/D73042
This facilitates monitoring the navigation response.
The remaining work for moving navigation-related code into
the parent process should be done in Bug 1612538.
Differential Revision: https://phabricator.services.mozilla.com/D71654