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
There are needs to delay the execution of code on the main thread
until the next tick of the event loop has happened.
Differential Revision: https://phabricator.services.mozilla.com/D71291
Tests are mixing APIs between each other, which this patch removes.
Also error messages have been adjusted for both methods to
be on par with Chrome.
Differential Revision: https://phabricator.services.mozilla.com/D67840
--HG--
extra : moz-landing-system : lando
Evaluating `document.open` + `write` + `close` triggers the `readyState`
to change to "loading". Puppeteer, for example, relies on a seeing an
"init" life cycle event in that case for their `Page.setContent` method.
Also move "Page.loadEventFired" to be triggered by an actual "load"
instead of "pagehide", which we don't see after a `document.write`.
Differential Revision: https://phabricator.services.mozilla.com/D67702
--HG--
extra : moz-landing-system : lando
I made some changes in preparation for removing nsIScriptError.flags in favor
of nsIConsoleMessage.logLevel.
Differential Revision: https://phabricator.services.mozilla.com/D66878
--HG--
extra : moz-landing-system : lando
I am not sure if you are okay with reviewing all those test changes.
Sadly it's not that easy to search through our huge JavaScript code
base for some generic name like 'isStrict'.
Differential Revision: https://phabricator.services.mozilla.com/D66573
--HG--
extra : moz-landing-system : lando
It's uncelar if this should be mapped to CRASH or ERROR, but
it probably doesn't matter much; it seems to be a fatal error
that terminates the rest of the run, but we don't get a stack.
I arbitarily chose CRASH.
Differential Revision: https://phabricator.services.mozilla.com/D66753
--HG--
extra : moz-landing-system : lando
Use mozlog to handle logging from the `mach puppeteer-test`
command. This makes the output compatible with treeherder and allows
generating error summaries that can be used by the push-health
feature.
Presently the integration is based on parsing the output from mocha
with regex since that's easy to implement without digging into the
many layers of js code too much. In time it might make sense to
replace this with a custom output formatter integrated into mocha
itself.
We also add the ability to store and use expected results, so that we
are able to detect regressions even when not all test are passing. The
format of expected results is Dict[String, List[String]], where the
keys are test names and the values are lists of statuses. If the list
has more than one value the remaining values are treated as possible
intermittent statuses.
The updated expected statues can be generated by passing the
--write-results flag to the mach command.
Differential Revision: https://phabricator.services.mozilla.com/D65700
--HG--
extra : moz-landing-system : lando
Values like NaN, Infinity, -Infinity are not serializable and have
to be returned via the unserializable property and not as value.
This patch also adds the type and description properties as
Puppeteer tests require, but leaves out support for
BigInt (bug 1615360).
Differential Revision: https://phabricator.services.mozilla.com/D62778
--HG--
extra : moz-landing-system : lando
This introduces a -v[v] flag to the "./mach puppeteer-test" command
for increasing the logging verbosity of the remote agent in Gecko.
This can be used as a shorthand for --setpref="remote.log.level=<level>".
A single -v will enable log messages up to debug level, and two
-vv will enable all log messages up to trace level.
Differential Revision: https://phabricator.services.mozilla.com/D58619
--HG--
extra : moz-landing-system : lando
The "./mach puppeteer-test" command now takes a new flag,
--enable-fission, which will set the fission.autostart preference to true.
Differential Revision: https://phabricator.services.mozilla.com/D58512
--HG--
extra : moz-landing-system : lando
Puppeteer accepts an environmental variable EXTRA_LAUNCH_OPTIONS
that is a JSON encoded object as a string, containing additional
configuration to use when running tests.
This takes an extraPrefsFirefox key which is an object
mapping preference names to values. This is extracted in
remote/test/puppeteer/lib/Launcher.js:390 and later written to a
fresh profile in :515.
It appears remote/mach_commands.py has left out the "Firefox" appendix.
Differential Revision: https://phabricator.services.mozilla.com/D58511
--HG--
extra : moz-landing-system : lando
Bug 1605722 already added those helpers to the global head.js file.
As such they can be removed from the target's head.js file.
Differential Revision: https://phabricator.services.mozilla.com/D58163
--HG--
extra : moz-landing-system : lando
This feature is experimental and not required to get implemented
on our end as of now. As such adding a place-holder will be enough.
Differential Revision: https://phabricator.services.mozilla.com/D59006
--HG--
extra : moz-landing-system : lando
Similarly to bug 1603451, the name of the function passed to the
specialised add_agent_task() is lost because of the anonymous
function wrapper inside.
Differential Revision: https://phabricator.services.mozilla.com/D58967
--HG--
extra : moz-landing-system : lando
When remote.log.level is Log.Level.Info or above, verbose logging
is enabled and we pretty-print JSON payloads in requests to the
HTTPD in JSONHandler.
This patch matches the behaviour of the JSONHandler logging, where
JSON payloads are logged to stdout with special formatting before
being transmitted across WebSocket connections.
Differential Revision: https://phabricator.services.mozilla.com/D58506
--HG--
extra : moz-landing-system : lando
The CDP protocol expects consistent types to be returned. By filtering
out null values and strings of zero length we break this promise.
Differential Revision: https://phabricator.services.mozilla.com/D58620
--HG--
extra : moz-landing-system : lando
Upgrading to http 0.2 will give us bytes ^0.5 which removes
a dependency on iovec. iovec is problematic for us because it
depends on a version of winapi that does not compile on Windows AArch64.
The effect of this should be that the remote agent is now possible
to compile on Windows AArch64.
Differential Revision: https://phabricator.services.mozilla.com/D58765
--HG--
extra : moz-landing-system : lando
nsIHttpServer.registerPathHandler() is designed to take null as
the second argument to unregister path handlers. This saves us
from having to modify its internal state, and fixes a minor TODO
in the remote agent initialisation code.
Differential Revision: https://phabricator.services.mozilla.com/D58605
--HG--
extra : moz-landing-system : lando
We were lacking documentation on how to run inidividual Puppeteer
tests. It turns out this is not possible yet to do on a per-file
basis, like other test harnesses.
Instead, suggest use of fdescribe()/fit() and recommend some useful
Mocha flags.
Differential Revision: https://phabricator.services.mozilla.com/D58618
--HG--
extra : moz-landing-system : lando
This reverts the commit:
git: d640ab64b993431099cd9205297bfff464d76927
hg: 9f6327c0d8298ec58a6c9f8d51526872d01d765e
Differential Revision: https://phabricator.services.mozilla.com/D58503
--HG--
extra : moz-landing-system : lando
This reverts the commit:
git: d640ab64b993431099cd9205297bfff464d76927
hg: 9f6327c0d8298ec58a6c9f8d51526872d01d765e
Differential Revision: https://phabricator.services.mozilla.com/D58503
--HG--
extra : moz-landing-system : lando
Errors that arise from use of the protocol, for example by the client
passing in the wrong argument or an operationg being unsupported, are
returned to the client. Since these are not inherent implementation
problems there is no point to double-logging them in the server.
This is a left-over from when the remote agent was in a prototype
stage and we couldn't always rely on the Puppeteer client to
interact with Firefox correctly.
Differential Revision: https://phabricator.services.mozilla.com/D58508
--HG--
extra : moz-landing-system : lando
When remote.log.level is Log.Level.Info or above, verbose logging
is enabled and we pretty-print JSON payloads in requests to the
HTTPD in JSONHandler.
This patch matches the behaviour with JSON payloads being transmitted
across WebSocket connections.
Differential Revision: https://phabricator.services.mozilla.com/D58506
--HG--
extra : moz-landing-system : lando
Moving the JSON payload sanitisation function to Protocol.jsm
means we can share it across modules.
The patch also adds new tests.
Differential Revision: https://phabricator.services.mozilla.com/D58505
--HG--
extra : moz-landing-system : lando
This patch adds basic support for retrieving cookies,
which means that it returns the cookies for the currently
active target.
Hereby it has the following limitations:
1. It does not walk the frame tree, and as such only returns
the cookies from the top-level frame. Support for that will
be added once frames can correctly be handled, which means
once support for the JSWindowActor API has been landed.
2. The "urls" parameter is not supported because it is
unclear right now what it actually does. More investigation
is necessary before any implementation can happen.
3. There is no support for the file:// protocol yet.
4. Dot domains aren't taken care of yet.
Differential Revision: https://phabricator.services.mozilla.com/D57614
--HG--
extra : moz-landing-system : lando
The browser-chrome test name is derived from the function name.
The function name of the original task is lost when wrapped inside
the add_task() override in remote/test/browser/head.js.
This fixes the problem by rewriting the taskFn name on the new wrapper.
Differential Revision: https://phabricator.services.mozilla.com/D57079
--HG--
extra : moz-landing-system : lando
The documentation for the overridden add_task() is quite poor.
Document it as to not confuse new developers why it is behaving
differently to the default bc add_task().
DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D57078
--HG--
extra : moz-landing-system : lando
This patch implements the IO.read() method to allow
reading streams for files and blobs.
Therefor all the methods in the IO domain need a registry
for streams. Those have to be stored globally because
they need to be kept existent across different client
connections.
Differential Revision: https://phabricator.services.mozilla.com/D55968
--HG--
extra : moz-landing-system : lando
This is generally pretty straightforward, and rewrites nearly all calls. It
skips the ones that it can detect using frame script globals like
`sendAsyncMessage`, though.
Differential Revision: https://phabricator.services.mozilla.com/D53740
--HG--
extra : moz-landing-system : lando
Adds browser-chrome tests for the main entry point of the remote
agent, nsIRemoteAgent.
add_agent_task() wraps add_plain_task() (which again wraps the
original add_task()) so we can ensure that the agent isn't listening
before a test runs, and that any modified state such as preferences
is reset afterwards.
The tests rely heavily on the assumption that nsIRemoteAgent.close()
behaves as a no-op when the server is not listening.
This patch is a follow-up to bug 1590828.
Differential Revision: https://phabricator.services.mozilla.com/D55456
--HG--
extra : moz-landing-system : lando
This is generally pretty straightforward, and rewrites nearly all calls. It
skips the ones that it can detect using frame script globals like
`sendAsyncMessage`, though.
Differential Revision: https://phabricator.services.mozilla.com/D53740
--HG--
extra : moz-landing-system : lando
This does not support the grantUniversalAccess parameter.
It just creates a new execution context.
Differential Revision: https://phabricator.services.mozilla.com/D55169
--HG--
extra : moz-landing-system : lando
As noted in Bug 1602083, the CDP viewer implies that execution context management
is independent of the Runtime domain, which makes sense with the behaviour of methods
like Page.createIsolatedWorld.
This is a first step in that direction.
Depends on D55168
Differential Revision: https://phabricator.services.mozilla.com/D56279
--HG--
extra : moz-landing-system : lando
Dismantle the assumption that there is one ExecutionContext per
inner window and generate a fresh id for each ExecutionContext
rather than reusing the inner window id.
Differential Revision: https://phabricator.services.mozilla.com/D55168
--HG--
extra : moz-landing-system : lando