This introduces a few helpers to work with the state now
that we don't use immutable anymore.
MozReview-Commit-ID: D9aR7kbapZg
--HG--
extra : rebase_source : 0ecf7240b0f8a6297e8f442cf65753dc506fd021
extra : source : 6872e6e6c1ff5b526c11b9a87c72cd3a0dc56aab
We drop the part of the test which tests the output of document.body
since it's already tested in reps.
MozReview-Commit-ID: JKmGNHRw6Iu
--HG--
rename : devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_document_body_autocomplete.js => devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_autocomplete_native_getters.js
extra : rebase_source : adbb2a8effbc1a611971f77faf7c1a2d2995131f
The reducer code was still trying to use Immutable.Record.get, although
we switched the state to a native js object. This was throwing an error.
Adding assertion to the existing tests that was failing without the fix.
MozReview-Commit-ID: Klj94ApJr4Y
--HG--
extra : rebase_source : 203a5028cc9988925fffba29b095d48599e41153
extra : source : 94d12ed69afd1ddb320a4cfca6db6b72a9a2db9a
Changes:
- Added testUtils to React DOMs Proxy MonkeyPatch.
- Removed TestUtils where it is not needed.
- Added syntax identifiers to Markdown fences just because VSCode can do syntax highlighting in the markdown itself when you do that.
- In our require-helper.js files I have had to keep the name "react-addons-test-utils." This is because Enzyme uses the require paths to choose which adapters are needed (none are... yet)... we will need to use "react-addons-test-utils" instead of "react-dom/test-utils" as the path until we upgrade to React 16+.
MozReview-Commit-ID: H1tgzfp0MXl
--HG--
extra : rebase_source : cbdd59f6256703e7aba2dac76aece94c1101898e
In Bug 1371721, we created a new action to batch our message addition into the store. Which means that messages can be pruned when using this action,
and implies releasing server actors.
But, at the moment, we only do that when we use the MESSAGE_ADD action.
This wasn't caught by tests because they explicitly use the MESSAGE_ADD action.
This patch makes the console release actors in reaction to a MESSAGES_ADD
action and add a test to make sure we handle this as expected.
MozReview-Commit-ID: FfgvmKi9nM9
--HG--
extra : rebase_source : a0416fd911699dac7addb37fffc42aa61d8824a5
This changeset adds basic remote connection functionality to about:debugging.
About:debugging can target a remote firefox instance if the host and port
parameters are passed as URL search params.
The feature is not explicitly exposed at the moment and there is no UI to
connect an instance, and no UI feedback when connected to a remote instance.
When connected, about:debugging should correctly list tabs, workers and addons
for the target instance of Firefox. Debugging features work for all supported
targets.
Known limitations:
- preferences are read from the local Firefox instance (multiprocess, addon
debugging etc...). At the moment the remote instance must be manually
correctly configured
MozReview-Commit-ID: DOekSCb96XC
--HG--
extra : rebase_source : 89b73e885e50bfba4e1888f8791f637a5ba05ca7
extra : intermediate-source : 840e23f2a496e2cec280643fef127095bd67d518
extra : source : 6cc5cc4494e67ae9dd7371420710c3f8afe5b256
This patch adds a new performance recording panel that interfaes with
perf.html. It is enabled through the new preferences:
"devtools.performance.new-panel-enabled"
MozReview-Commit-ID: 1HBLsbREDPk
--HG--
extra : rebase_source : 22cc2826138c4891024c34947f145574f55b4541
The local clearOutput defined in new-webconsole.js was only used in one
place, in the same file, on tab navigation. It would probably be best to
reuse the same code path as in other places, ie jsterm.clearOutput().
(plus the clear storage argument of the local method was never used).
MozReview-Commit-ID: 9suQTgUGCBA
--HG--
extra : rebase_source : 72fe5559514a5977703a77cbb344b40b9ef60160
This patch adds a new performance recording panel that interfaes with
perf.html. It is enabled through the new preferences:
"devtools.performance.new-panel-enabled"
MozReview-Commit-ID: 1HBLsbREDPk
--HG--
extra : rebase_source : 4db73267d9868c4c62d2619111f875338c8e6171
This also renames the support files.
MozReview-Commit-ID: 9TqERvD5EFA
--HG--
rename : devtools/client/webconsole/new-console-output/test/mochitest/test_bug1045902_console_csp_ignore_reflected_xss_message.html => devtools/client/webconsole/new-console-output/test/mochitest/test_console_csp_ignore_reflected_xss_message.html
rename : devtools/client/webconsole/new-console-output/test/mochitest/test_bug1045902_console_csp_ignore_reflected_xss_message.html^headers^ => devtools/client/webconsole/new-console-output/test/mochitest/test_console_csp_ignore_reflected_xss_message.html^headers^
extra : rebase_source : be782c9fee52551a8f3d248208cc40c0c2963e36
Most of the codebase that needs to create a debugger server
can use a server with all actors registered.
Define an additional method registerAllActors to do that.
By previous implementations, all the call sites that were
using browser: true were indirectly using tab & root: true
as well. So all the call sites using browser: true have been
migrated to registerAllActors and the specific behavior of
the browser: true case has been removed. Passing browser:true
to registerActors now only registers browser specific actors.
MozReview-Commit-ID: F3sx71eGrdG
--HG--
extra : rebase_source : 7704264e84d96e03a0c789103ff466980913d4d2
DebuggerServer.init() already bails out if it was previously initialized
so we could avoid guarding the calls to init() with it everywhere.
Registering an actor module several times is also a noop as the Server
keeps a map of all the already registered modules and will bail out if
the module is already known.
MozReview-Commit-ID: 4ONLlx9253i
--HG--
extra : rebase_source : a6fce209baf5e019b6a216761c01832a30332343
DebuggerServer has old APIs addBrowserActors & addTabActors that can be
replaced by calls to registerActors.
MozReview-Commit-ID: KpYJpbSHM8I
--HG--
extra : rebase_source : c7f20edf503b944ef2582b5fe73bd6d899c0d1cc
The tab argument was unused in the method. All the call sites have been updated to
stop providing this argument. The method now supports an optional tab argument.
It defaults to the selected tab if no argument is provided.
MozReview-Commit-ID: 621dgljHdtD
--HG--
extra : rebase_source : 676c998cb4b2f126d9ee075760e2d7d30078344b
Test will be enabled in Bug 1406038. This requires some Reps work.
MozReview-Commit-ID: CpU25kiXiR1
--HG--
extra : rebase_source : d0c0f7c04f5c507b9ec17d6358b07cc30179b384
This method was added in bug 1262439 last year, and shipped with FF50.
We support all the way back to the latest ESR (52 now).
So let's remove the backward compat code for this method.
MozReview-Commit-ID: LUL7FFWWC5M
--HG--
extra : rebase_source : 27969faff9e8827e23ff570addfde5c06fb57c97
The scrollIntoView actor method was added in bug 901250 3 years ago and
shipped with FF 40.
We support all the way back to the latest ESR (52 now).
So let's drop this backward compat check code.
MozReview-Commit-ID: 5FKRpiOXfzd
--HG--
extra : rebase_source : 4c3b0850750081a87b77bc1b85d7a2e852f58c82
This method was added in bug 1208864 2 years ago and shipped with Firefox 44.
We support all the way to the latest ESR, which now is 52.
So let's remove this backward compat code.
MozReview-Commit-ID: AdTU63Oehi4
--HG--
extra : rebase_source : 481f768101212db1f363c9b5204f7654aaea5208
The resolveRelativeURL actor method was added in bug 921102 which shipped
with Firefox 40.
This was 3 years ago, and well older than the latest current ESR (52), which
is the latest version we support.
MozReview-Commit-ID: 5X5czLP5v2E
--HG--
extra : rebase_source : 7c1ee2c2a78151eb94ef1f1bacff6396d3ceb24e
Add dependencies that weren't included in devtools-launchpad no more.
MozReview-Commit-ID: 39KkXvQsR7S
--HG--
extra : rebase_source : 3501a488774044cef2f4d9844b17123a40372a2a
We only label Object as being ArrayLike if they have consecutive, numeric indexes, starting at 0,
and that could contain only a non-numeric length property that matches the actual number of numeric
keys in the object.
A test is added to make sure we don't regress this.
Fix old console frontend tests which relied on the bad implementation of ArrayLike (and delete
test cases now covered by the server test).
MozReview-Commit-ID: ATF7WypNVhh
--HG--
extra : rebase_source : 5e6a0ef0da84cf89518164f518a257bd1f0d5fd8
This test was checking the HTTPinspector by directly calling a WebConsoleClient function
which is no longer used in console code.
MozReview-Commit-ID: LxjhhO2rB0W
--HG--
extra : rebase_source : 411c18a62ae97102907b35f5d5e26749b48047f5
When web-ext (the nodejs CLI tool which is often used to develop a WebExtension)
starts Firefox with the --start-debugger-server CLI parameter,
devtools/shims/devtools-startup.js creates a DebuggerServer instance in an
isolated separate module loader, marked invisible to the debugger so that
we can use it to debug the regular DebuggerServer instance (loaded internally
when the user is going to open one of the developer tools for the first time).
Right after this "debugger invisible" DebuggerServer instance is started,
web-ext connects to the debugger server and interacts with the RDP actors
(e.g. to list the addons actors, install the extensions temporarily, reload
the extensions etc.), and as a side-effect of connecting to the WebExtensions
RDP actor, the "devtools/server/child.js" module is going to be loaded,
and it will be loaded in the main process if the webextensions are not
configured to run in a separate extension child process
(on the contrary it would be loaded in a child process when the
the extensions are running in oop mode).
If the regular developer tools have been already opened by the user (e.g.
when --jsconsole has been passed to the Firefox command line, which
is what happens when web-ext is executed with the --bc command line option),
the DebuggerServer is initialized and the browser actors added to it,
on the contrary when the "devtools/server/child.js" module initializes
the DebuggerServer module for the first time, it doesn't add the browser actors
to it and so the DebuggerServer instance is going initialized but it will be
missing the createRootActor attribute (which is expected if the DebuggerServer
instance is initialized in a child process, but it is unexpected when the DebuggerServer
instance is the one that serves the main process).
MozReview-Commit-ID: GE51X14HfHJ
--HG--
extra : rebase_source : 65e3a0c02f8a419dc8588184dff56d3c07e430a9
In Bug 1404917, we introduced loading the
/devtools/client/netmonitor/test/shared-head.js
file in devtools/client/webconsole/new-console-output/test/mochitest/head.js.
But, the shared file is not declared in browser.ini,
which ends up making variabled from head.js inaccessible,
and some tests that relies on them to fail.
This was not picked up by TRY because the netmonitor tests
are ran before the console's one, which loads
devtools/client/netmonitor/test/shared-head.js .
MozReview-Commit-ID: 80OOUHwjnWL
--HG--
extra : rebase_source : 70a21db32ab3aee38946cc962bede9689a86045b
Switch some calls to addOneTimeListener from callback-style to Promise.
MozReview-Commit-ID: F9AlSvK0MAH
--HG--
extra : rebase_source : 076522e89004f8a4634b4f7732800a5ec14ce633
Once the test was migrated, it was failing because we did not show
error messages for invalid cd() calls.
There was a missing part in the evaluation result prepare message, which
this patch fixes. A stub and a mocha test were added to make sure we do
display those kind of messages.
MozReview-Commit-ID: FcTsP2pr3vD
--HG--
rename : devtools/client/webconsole/new-console-output/test/mochitest/test-bug-609872-cd-iframe-child.html => devtools/client/webconsole/new-console-output/test/mochitest/test-cd-iframe-child.html
rename : devtools/client/webconsole/new-console-output/test/mochitest/test-bug-609872-cd-iframe-parent.html => devtools/client/webconsole/new-console-output/test/mochitest/test-cd-iframe-parent.html
extra : rebase_source : 8fc82b71875cebfed0e318d1eba8b5332dc650c7
@Honza: Please wait for a green try before reviewing this.
MozReview-Commit-ID: 5KlOkYLnorj
--HG--
extra : rebase_source : 339c2dda1eb2afaf490e6bacb613addeece42d04
@nchevobbe: Please wait for a green try before reviewing this.
MozReview-Commit-ID: 9SLEHAq0IQQ
--HG--
extra : rebase_source : f3864d13d36802914171581f9f60351cf71aad2f
As you add more than 7 or so custom devices, the modal will eventually wrap to
a 4th column. Adding some more width allows that to happen without a horizontal
scroll bar.
This width looks natural without custom devices as well, and its not too large
for the most popular screen size (1366 x 768).
MozReview-Commit-ID: 5IErG8NX3xO
--HG--
extra : rebase_source : cbdb862597ef1774964bea135da6376e0cbb7650
@nchevobbe: Please wait for a green try before reviewing this.
MozReview-Commit-ID: 9SLEHAq0IQQ
--HG--
extra : rebase_source : b916d948f3712bf4f09e50436cbdd0cf0f12afb4
Response content should only be fetched whenever it is strictly needed
as it is the response body. A possibly very large string.
So, netmonitor UI should only retrieve it when users select the Response Panel
or do any other action that require having access to it (like "Copy response"
context menu).
MozReview-Commit-ID: CtpJ8PKsCsm
--HG--
extra : rebase_source : 4540f641e511b2199436ad5c2edccda8aff37634
Adding an HTML preview above the raw payload viewer on the developer
tools response tab caused browser_net_cyrillic-02.js to fail since
CodeMirror only renders visible lines to the DOM. The new HTML preview
shares space with the CodeMirror editor, so the resulting height became
shorter; enough to hide the line this test was looking for.
This solution uses CodeMirror.getValue() to retrieve the contents of all
lines stored in memory. Checking against that will allow the test to
pass since it contains the cyrillic text. One downside is that this
makes the test less reliable since it may not be guaranteed that what
CodeMirror has buffered to render will actually be what's inserted into
the DOM.
Two other solutions were explored before settling on the one above. The
first was simulating scroll events through EventUtils.sendWheelAndPaint.
const event = {
deltaMode: WheelEvent.DOM_DELTA_LINE,
deltaY: 20
}
yield new Promise(resolve => {
EventUtils.sendWheelAndPaint(
document.querySelector(".CodeMirror-scroll"),
10,
10,
event,
resolve,
monitor.panelWin
);
})
This did scroll the editor enough to render content and pass the test,
but caused additional errors since monitor.panelWin did not have a
.waitForAllPaintsFlushed() method that EventUtils.sendWheelAndPaint
expected.
The below alternative uses a hard-coded scroll amount and a
requestAnimationFrame as a rough estimate of when scrolling finished.
It worked in the ten or so runs I tested, but there's nothing guaranteed
about requestAnimationFrame that indicates when CodeMirror's rendering
has finished.
document.querySelector(".CodeMirror-scroll").scrollBy(0, 200);
yield new Promise(resolve => requestAnimationFrame(resolve));
MozReview-Commit-ID: H95HjR8UNpx
--HG--
extra : rebase_source : 03e4cd1e3a9042fa565373487c5cbb1118530917
Restoring the HTML preview in the response panel was requested by many
users who rely on it to debug erroring AJAX requests. Many web backend
frameworks display an HTML stacktrace helping users trace down the
problem.
The html-preview.js component was taken from a previous commit of the
source code before the preview panel was removed. A few modifications
with its name and CSS classname were made.
MozReview-Commit-ID: JFyF6cBMaNf
--HG--
extra : rebase_source : 7e358f5fb4336a15f549ecb6f7e24cc00429de8e