We weren't checking properly undefined value, which was hiding issues in
some tests.
The helpers are fixed and a few test modified to make them pass.
Differential Revision: https://phabricator.services.mozilla.com/D119096
* avoid unwatching DOCUMENT_EVENT in case of target-switching
* ensure emitting DevToolsFrameChild:destroy for all currently registered target actors
(didDestroy was clearing the list of actors used by _getTargetActorForWatcherActorID)
* do not try to stop and restart server side watchers in case of bfcache navigation
Differential Revision: https://phabricator.services.mozilla.com/D118795
Renaming the actor makes it more explicit that it should
only be used for highlighter-related assertions.
We take this opportunity to rename all the 'testActor' instances
in tests to 'highlighterTestFront' which better represents
what the object is.
While doing this work, I was able to cleanup a few function definition
where the testActor parameter wasn't needed.
Differential Revision: https://phabricator.services.mozilla.com/D117978
Calls to targetFront.isTopLevel can happen after a given target is destroyed, and
in such case `getTrait` was throwing as the `client` property of the target is nullified.
To fix this, we're directly checking if the targetForm has a `isTopLevelTarget`,
and if not, we default to the property we set in `setTargetType`.
Another issue was caused by the `_url` property, used in the `url` getter,
being nullified when in TargetMixin#destroy, which was making the WorkerDescriptor#name
to throw.
We now check that the url isn't null before trying to use it.
Differential Revision: https://phabricator.services.mozilla.com/D117011
Surprisingly, previous changeset fix this. Following changeset is rather there for cleanups.
The fact that we instantiate a first JSWindowActor pair from frame-helper seems to do the trick.
The new code in frame-helper no longer conditionaly create the target for the top BC.
I also silent an exception happening in this test without fission.
Differential Revision: https://phabricator.services.mozilla.com/D117472
This only failed with devtools.target-switching.server.enabled=true as we emit top level target
from the Watcher only when this is enabled.
This is covered by browser_target_list_frames.js asserting a precise order in targets.
This test was failing with the pref set to true and should now pass in all 4 configurations.
(fission on/off + server target on/off)
Also try to destroy the top level target last, after all the remote iframes ones, but I'm not sure it is as important.
Note that we were trying to add the top level BC multiple times between code in utils.js vs worker-helper and frame-helper:getWatchingBrowsingContexts.
Differential Revision: https://phabricator.services.mozilla.com/D117471
This is slightly complicated by the fact that the editor code wants to be able
to set this from the content process, so we really need separate
BrowsingContext and WindowContext flags, the latter of which can be set by the
owning process.
Differential Revision: https://phabricator.services.mozilla.com/D114899
This adds support for server target-switching for parent process storage resources (cookies and indexedDB at the moment)
Differential Revision: https://phabricator.services.mozilla.com/D114600
While we don't emit DOCUMENT_EVENT's for in-process iframes, each new target
will generate DOCUMENT_EVENT for the target's top level document.
So that the frontend do receive DOCUMENT_EVENT's for the remote iframes, in addition to the top level target document.
In most cases, we listen to will-navigate only to watch the top most top level document
and only this one, so we should only consider the top level target's DOCUMENT_EVENT.
As a side effect, we can re-enable browser_inspector_fission_frame_navigation.js which was failing because of this.
Differential Revision: https://phabricator.services.mozilla.com/D117184
Doing this helps knowing if some resources are coming from ResourceCommand cache,
or if they are live resources coming from the server.
Differential Revision: https://phabricator.services.mozilla.com/D116984
This patch removes the `setTouchEventsOverride` method on the targetConfigurationCommand,
as we're now enabling the touch simulation from the server, in `BrowsingContextActor#updateTargetConfiguration`.
A new configuration property is added, `reloadOnTouchSimulationToggle`, so the
actor is responsible for reloading the page if the user set the pref.
The `touchSimulator` property is moved from the responsive actor to the browsingContext one
to facilitate managing the touch simulation state.
Differential Revision: https://phabricator.services.mozilla.com/D116103
This helps execute code on navigation, even if the document loads super fast
and target actor's navigate is emitted before frontend has a chance to register the navigate event.
Differential Revision: https://phabricator.services.mozilla.com/D115825
Tests that were using `evaluateJSAsync` are updated, either by using the new command,
or by awaiting for the `evaluationResult` event.
A couple chrome tests were moved to devtools/shared/commands/js/tests/ and turned
into browser tests, and some of them were completely removed as we tested the
features in mochitests as well.
Differential Revision: https://phabricator.services.mozilla.com/D116248
This method is meant to replace the direct usage
of webconsoleFront.evaluateJSAsync.
The WebConsoleCommands file is removed, and all
client calls to evaluateJSAsync are migrated to
the new method. Callsites are simplified when
possible, and some test are refactored to switch
to spawned task to retrieve content page information.
Differential Revision: https://phabricator.services.mozilla.com/D116242
This patch removes the `setTouchEventsOverride` method on the targetConfigurationCommand,
as we're now enabling the touch simulation from the server, in `BrowsingContextActor#updateTargetConfiguration`.
A new configuration property is added, `reloadOnTouchSimulationToggle`, so the
actor is responsible for reloading the page if the user set the pref.
The `touchSimulator` property is moved from the responsive actor to the browsingContext one
to facilitate managing the touch simulation state.
Differential Revision: https://phabricator.services.mozilla.com/D116103
This code calling `watchResourcesForTarget` should only be called when
we already called `TargetCommand.watchTargets()`.
When we call `ResourceCommand.watchResources` for the first time, `TargetCommand.watchTargets`
will process already existing targets and call `ResourceCommand.onTargetAvailable` (which calls `watchResourcesForTarget`).
But for any subsequent call, we should use `TargetCommand.getAllTargets` and call `watchResourcesForTarget` manually.
Differential Revision: https://phabricator.services.mozilla.com/D116027
That's to ensure clearing the panels sooner than later.
A few tests depend on this. Without that, target actor's "navigate" event,
which isn't throttled, fires *before* DOCUMENT_EVENT's will-navigate.
That ends up being a logic issue in the console code.
Differential Revision: https://phabricator.services.mozilla.com/D112230