To fix this, we fallback to viewSource when we don't have access to the toolbox,
which is what was done in the old frontend.
MozReview-Commit-ID: JCcprTlViMi
--HG--
extra : rebase_source : ab13b539938a6572ebd9ceaedc23f954f4cb2be2
The mocha test are broken because we mock Services.pref,
and the assumptions we make in the mock are no longer valid.
Since we do have a fully functional replacement for Services
in devtools-modules, let's use it in our test.
Which means we need to introduce a mock for localStorage,
since it's what the devtools-modules Services uses, and helper
functions to replace what was in the Services mock.
MozReview-Commit-ID: KLHERfSa1Il
--HG--
extra : rebase_source : b1b5bc2d35624677fc241194ab1a49502cafe31d
This allow us to manage different sets of preferences for
the console and the browser console. The util object is
passed to the actions through a custom thunk middleware.
MozReview-Commit-ID: 6IQLBqX7KMN
--HG--
extra : rebase_source : 9dc60df24d0514c8bd0aac7655483eb3d026a16a
Note that this patch also replaces legacy VK_* with KEY_*, and replaces
synthesizeKey() for inputting some characters with sendString() because
it's better and clearer what it does and it sets shiftKey state properly.
MozReview-Commit-ID: De4enbjux3T
--HG--
extra : rebase_source : 2296b84bff8e22f01eeb48cd8614fac5db11136a
Along with removing the view source standalone windows and prefs this patch:
1) Re-structures several of the view source tests that were only testing the old
standalone windows to now test view source in tab.
2) Adds support viewSourceUtils.viewSource() to open a browser window when there
aren't any open (for browser toolbox view source).
3) Cleans up some of the API for viewSourceUtils and removes the old deprecated
ways of calling it.
MozReview-Commit-ID: DI6sgZwbCf
--HG--
extra : rebase_source : 64677186122f74ab95912d5f3f173cf37472458a
We can now remove the extra `.browser-container` element around the frame. It
was only here as a way to invoke React's `innerHTML` for real content.
MozReview-Commit-ID: 1wnv7SJmjTd
--HG--
extra : rebase_source : 12435e53d069d23adc22de4b1ba0259912ad6027
Now that we have React 16 (which includes support for custom attributes instead
of a fixed whitelist), we can create the browser frame in the "usual" way, as
opposed to this `innerHTML` workaround.
MozReview-Commit-ID: GwZVNIqF1QC
--HG--
extra : rebase_source : eec7a2c54638420b1a7adc27f25e1f0237eaa30e
As well as flipping the pref on, this also moves the pref to the common all.js
prefs file because the pref is used by DevTools server code.
MozReview-Commit-ID: GfkLfXg1EiR
--HG--
extra : rebase_source : 952dcc4bce3f9f2ae598a98be3b63a70ba4068b2
See the comment on "Address test failures caused by bumping timer precision to 2 ms"
for more details.
MozReview-Commit-ID: LrsucEPdZIo
--HG--
extra : rebase_source : 8147c034f7dc93f678eebc80b0afabf55729d804
If the duration was 0ms, it would not be cleaned; and thus lead to a mismatch and
ultimately test failure.
MozReview-Commit-ID: 1s9nMzlGT0e
--HG--
extra : rebase_source : 6c5dfe6dcc4fcf767d5b47878f09f3d1089d8dd2
This test is an exact duplicate of browser_webconsole_variables_view_while_debugging_and_inspecting.js
except it doesn't start the inspector before performing the test.
I don't think it's worth keeping and maintaining both tests.
MozReview-Commit-ID: 7EcdVmJjAfu
--HG--
extra : rebase_source : 3204d7c3f6c930330d3cb4d65f7b1dacac594dba
There are a few different reasons why tests needed updating (not an exhaustive list):
- Tests assume that successive operations take place at different times.
- Tests assume that an operation took a minimum amount of time.
- Tests hardcodes a specific delay.
In most cases we hardcode the preference off. In some cases this is the best approach,
in others, we would like to improve. The bug for tracking those improvements is Bug 1429648
An improvement that is present in some tests is to hardcode a specific precision reduction
that is acceptable based on the confides of the test. (Obviously this needs to be a fix for
the test framework and not a requirement on the feature being tested.)
In a few places, the test itself can be fixed, for example to no longer require the end
time of an operation to be strictly greater than the start time, and allows it to be equal
to it.
MozReview-Commit-ID: J59c7xQtZZJ
--HG--
extra : rebase_source : df8a03e76eaf9cdc9524dbb3eb9035af237e534b
This affects several tests, and in all but one case merely disables timer precision
reduction on those tests.
In the other singular test, it no longer requires the end time of an operation to
be strictly greater than the start time, and allows it to be equal to it.
MozReview-Commit-ID: J59c7xQtZZJ
--HG--
extra : rebase_source : c82310ce0269798a9c5bfffaec1f63a24ddc98e5
All the content from this test is already covered in
- browser_webconsole_allow_mixedcontent_securityerrors.js
- browser_webconsole_filters.js
MozReview-Commit-ID: LUVDI6DmJiB
--HG--
extra : rebase_source : 56e20155dd1569259cc1b40fc38a894de1e0c146
The part on the copy context menu was removed since we have a dedicated test
for that.
We also delete browser_webconsole_jsterm_copy.js which was doing the same thing.
MozReview-Commit-ID: BGPkeHWb2bL
--HG--
extra : rebase_source : 10fba3160c84af68f65f4bd3059f4b877f2d6051
This will allow us to hide the input for the browser console.
MozReview-Commit-ID: AOltH7HakQE
--HG--
extra : rebase_source : 6f5f278ea69af479c8e1eda87f939ac30a8d6ae7
The test was doing a lot of things and was hard to follow.
Here we split it so we can have dedicated tests for each helpers.
MozReview-Commit-ID: 6YGR3aq6jYn
--HG--
rename : devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_jsterm.js => devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_document_no_xray.js
rename : devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_jsterm.js => devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_error_docs.js
rename : devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_jsterm.js => devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_error_outside_valid_range.js
rename : devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_jsterm.js => devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_helper_dollar.js
rename : devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_jsterm.js => devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_helper_dollar_dollar.js
rename : devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_jsterm.js => devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_helper_dollar_x.js
rename : devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_jsterm.js => devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_helper_help.js
rename : devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_jsterm.js => devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_helper_keys_values.js
rename : devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_jsterm.js => devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_helper_pprint.js
rename : devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_jsterm.js => devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_instance_of.js
rename : devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_jsterm.js => devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_null_undefined.js
extra : rebase_source : dafa772bcbc6b379fd6ec1137c07ba24e794fc71
Since we don't run babel on the mocha tests anymore, we don't need to have a dedicated
env config in babelrc.
Also, bump min node version in both netmonitor and webconsole since we require async/await
to be supported.
Remove the "devDependencies" from netmonitor as we don't really have any use of it.
MozReview-Commit-ID: Ep4u59TZHAf
--HG--
extra : rebase_source : f3b184c83b063fdf1758b2ed4ecf57dd1b16641d
There was a few things wrong with new-console-output/test/package.json:
- It had a dependency on the netmonitor folder, which means that we were
pulling all the dependencies from netmonitor's package.json, including
the launchpad, which we don't want. It was done so netmonitor's babelrc
would find the plugins it needed. This is now fixed by not using babel at all.
Removing babel allowed us to get rid of NODE_PATH hack which could have been
harmful. This was doable by modifying the require-hacker callback to rewrite
all mozilla-central require to absolute path.
- The complex `test` script command wasn't documented. We now use the "//"
key to add comments (we have to since we're in a json file), which is ignored
by npm.
- We were running some tests from the node_modules folder since our glob
wasn't restrictive. We now only target folders where we do have mocha tests.
- As a consequence, we were pulling dependencies that were needed for those
tests, but not for ours.
- The Enzyme configuration was done before declaring the require hook, which
again forced us to pull dependencies that we don't need.
MozReview-Commit-ID: K7NXersnis8
--HG--
extra : rebase_source : 617b67921dd3bddaadc04b0901ece63581b98097
This test had some cases that weren't covered in our mocha tests,
so we add them. In order to do that, we added a stub.
We remove the mochitest and its support file.
Since the support file was used by another test, we modify it to
add the part that was used.
MozReview-Commit-ID: AL4qWcWHQiA
--HG--
extra : rebase_source : 632e10a25c724044979d2ef4a02648e95ff88bbb
In this component we had an <a> element as a child of another <a> element,
which isn't valid. Furthermore, we didn't make use of this <a>, so switching
to a span brings us validity without any drawbacks.
MozReview-Commit-ID: 3EM8jkEtSKI
--HG--
extra : rebase_source : 9b585b7a0dfb251b80d7712ed8dd18169a474199
Since React 16 landed in the toolbox, we should have it as well in the launchpad and in tests.
This forced us to do some changes:
- Remove the Perf util hook in local-dev
- Update Enzyme to version 3
- Add an enzyme adapter for React.
- Add react-prop-types dependency
The require-helper file is renamed into mocha-test-setup since it takes care of many things now.
MozReview-Commit-ID: 2tDRjrjc4Dh
--HG--
rename : devtools/client/webconsole/new-console-output/test/require-helper.js => devtools/client/webconsole/new-console-output/test/mocha-test-setup.js
extra : rebase_source : b46d2da643735c4f07238606f7c78c897fe13626
This will free the tests of the devtools-launchpad dependency so we
have a more robust workflow. Also, this will facilitate running those
tests on CI.
MozReview-Commit-ID: JkF89YBxlO4
--HG--
rename : devtools/client/webconsole/package.json => devtools/client/webconsole/new-console-output/test/package.json
extra : rebase_source : 337c06ee4c0892bbc2fdbd750582ffb360a1f3e3
If the user tried to evaluate `throw ""`, an "undefined" message was displayed
in the console output, which is wrong. Some changes needed to be made to the
messages util to better handle those cases.
MozReview-Commit-ID: Is5pJYB2N48
--HG--
extra : rebase_source : 90a95af6bf7f5046e652b02263ae118fc4156693
The README file provides information about the WebConsole, its architecture,
how to run it, how to run tests, …
The README file in new-console-output/test is updated.
MozReview-Commit-ID: LofromidTWl
--HG--
extra : rebase_source : 10c34941ded3d5f778be1f385f67ce3537487555
Deleting lines in part 1 caused two tests to break, because they check
the line numbers for source files. The devtools part of the patch was
automatically generated.
MozReview-Commit-ID: DrDZeyVnpE0
--HG--
extra : rebase_source : 72c1623015f029a5adef20669cc102c568d3b67e
This patch was autogenerated by my decomponents.py
It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.
It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.
It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)
MozReview-Commit-ID: DeSHcClQ7cG
--HG--
extra : rebase_source : d9c41878036c1ef7766ef5e91a7005025bc1d72b
FunctionDeclarations are instantiated when we enter a scope, before any of the
code in that block/script/function is evaluated. The spec calls this phase
"declaration instantiation"; sometimes it's informally called "hoisting".
Before this patch, stepping would show this. You would step into a function,
and hitting the Step Over button a few times would visit all the nested functions
in that function. Then you would jump back to the top of the outer function and
actually start running the statements. This is so confusing that we are
changing it; now opcodes that instantiate functions don't have location
information, so stepping doesn't stop on those opcodes.
--HG--
extra : rebase_source : d8de1fc50573b82bf76dc7464355bfba068eaa30
extra : source : b94db3c0c2c0752915e2f4401269a0d24cbef882
This code has never worked correctly. Bug 911258 landed on 2013-09-09 and
removed the initialize() method from XPConnect exceptions. This code landed
two days after that. If it's ever reached, it will just throw when calling the
nonexistent initialize() method.
MozReview-Commit-ID: FWpP1fLBIPW
We'll stop dispatching keypress events on web contents for conforming to spec of
UI Events. Some existing tests assumes that keypress events are fired even
when non-printable keys are pressed.
This patch makes them check the pref,
"dom.keyboardevent.keypress.dispatch_non_printable_keys_only_system_group_in_content"
and only listen to keydown event instead of keypress even if the pref is true
and expected key event is not a printable key press.
MozReview-Commit-ID: 6bKoK7dsB0l
--HG--
extra : rebase_source : b3705b0814d5690e00208d0d3315f09f886c6f26
Adjust grid highlighter line numbers to rotate to the expected position outside
the grid container even in the presence of writing mode and text direction.
This is also refactors and preserves the recently added behavior to flip line
numbers inside the container if they are near the viewport edge.
MozReview-Commit-ID: 4zFjJY4Iqdz
--HG--
extra : rebase_source : 131af55ca55c7ae7b3c42fbd6b77f68236259009
This fixes InspectorUtils::getCSSValuesForProperty to return the
correct values for line-style-type.
MozReview-Commit-ID: 72Tes6y15j8
--HG--
extra : rebase_source : fa893f59cafc433f554353cf42d0f9495cdd5b23
Inspector actor traits were used for backward compatibility, with
versions of Firefox older than 45. Our policy is to support servers
up to the last ESR version, which is 52 at the moment so these
should be safe to remove.
MozReview-Commit-ID: 6MwUp8vbW29
--HG--
extra : rebase_source : b36799130e66e4abdaee628d48ad1b056bc1afcd
This changes getCSSValuesForProperty to return the correct values for
the "content" property.
MozReview-Commit-ID: 2F5LQPbSIFs
--HG--
extra : rebase_source : 290df953c8234888801b7a8a6ef5668a11a59bea
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm
MozReview-Commit-ID: 1Nc3XDu0wGl
--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
extra : intermediate-source : 34c999fa006bffe8705cf50c54708aa21a962e62
extra : histedit_source : b2be2c5e5d226e6c347312456a6ae339c1e634b0
This adds support for detecting globals created by these helpers, as well as a
rule to enforce their use over the older XPConnect variants.
The latter rule also supports fixing code to use the newer variants, and will
be used in the next part to rewrite in-tree ESLint-enabled code that fails it.
MozReview-Commit-ID: 6Bgo6ohQA5j
--HG--
extra : source : fbef09c3e8af1653f270db589f73f2786c23ddc2
extra : intermediate-source : e2674287e57fbf6835729f42b8491359c2c4bfd5
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm
MozReview-Commit-ID: 1Nc3XDu0wGl
--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
This adds support for detecting globals created by these helpers, as well as a
rule to enforce their use over the older XPConnect variants.
The latter rule also supports fixing code to use the newer variants, and will
be used in the next part to rewrite in-tree ESLint-enabled code that fails it.
MozReview-Commit-ID: 6Bgo6ohQA5j
--HG--
extra : source : fbef09c3e8af1653f270db589f73f2786c23ddc2
extra : intermediate-source : 8e4dcdb0f429003100e2727dad4108ab57087da2
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm
MozReview-Commit-ID: 1Nc3XDu0wGl
--HG--
extra : rebase_source : c004a023389f1f6bf3d2f3efe93c13d423b23ccd
This adds support for detecting globals created by these helpers, as well as a
rule to enforce their use over the older XPConnect variants.
The latter rule also supports fixing code to use the newer variants, and will
be used in the next part to rewrite in-tree ESLint-enabled code that fails it.
MozReview-Commit-ID: 6Bgo6ohQA5j
--HG--
extra : rebase_source : 4be020e5c28d8e72ff0aa9e66051fe493bfcce7c
extra : source : fbef09c3e8af1653f270db589f73f2786c23ddc2
This fixes getCSSValuesForProperty for clip and clip-path.
Although clip is deprecated, it seemed harmless to fix it as well;
when it is removed this code will also be readily found and removed.
It wasn't clear to me if setting the keyword table for clip-path in
nsCSSPropList.h would be ok, so I added a special case in
InspectorUtils.
MozReview-Commit-ID: Ghawr17HjKk
--HG--
extra : rebase_source : 29c094afd678019b4f3f49ac55493ef0d7d6848f