We'll stop dispatching keypress event for non-printable keys and key
combinations at least in web content. This means that widget of
devtools/client cannot be tested with loading them into tabs with mochitest
browser chrome. Fortunately, they are cleanly independent from other module's
keypress event listeners. So, we can make they use keydown event to handle
non-printable keys and key combinations.
MozReview-Commit-ID: 6fNSsGi9VbQ
--HG--
extra : rebase_source : d8c201d2233dd1c08a87ad5123aaa2942af643d7
To accomplish this, the added aria-pressed attribute turns the buttons into toggle buttons, and the one that is visually selected, gets the "true" attribute value, others are "false". That way, the screen reader and other assistive technologies will indicate that this is the selected or pressed button.
MozReview-Commit-ID: L2lcw2wOyYw
--HG--
extra : rebase_source : 1c0ad241319f50c34c120ce05b85e795e9a5b080
This will make it easier to include xul chunks with the preprocessor.
MozReview-Commit-ID: F3aF6CqqcSK
--HG--
extra : rebase_source : ccd0cb99ac9f1114d28cd749ec439c907d13836f
The prefix property was already on the packet, so all we had to
do was to support it. Which means:
- retrieve the property in the packet and pass it to the message
- when prefix exists, add a dom element with a custom style
- search in prefix when filtering.
We add a couple of mocha tests with a stub packet to make sure we
handle those cases like we should.
MozReview-Commit-ID: KFkt685AdfE
--HG--
extra : rebase_source : d73e96545400d5bb83c51953d1b75ac8e03ca959
This whole test neede rewriting. Beginning with the new console frontend we no longer block the object inspector in the browser console when `devtools.chrome.enabled === false`.
MozReview-Commit-ID: 9H5FvIbkYzk
--HG--
rename : devtools/client/webconsole/new-console-output/test/mochitest/browser_console_hide_jsterm_when_devtools_chrome_enabled_false.js => devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_hide_when_devtools_chrome_enabled_false.js
extra : rebase_source : a649b20be57d394ff24c5f2bafaf1d2b8687ff40
The prefix property was already on the packet, so all we had to
do was to support it. Which means:
- retrieve the property in the packet and pass it to the message
- when prefix exists, add a dom element with a custom style
- search in prefix when filtering.
We add a couple of mocha tests with a stub packet to make sure we
handle those cases like we should.
MozReview-Commit-ID: KFkt685AdfE
--HG--
extra : rebase_source : 71f13c07921b1d60df1a0c113d1e3fb440923ec2
The first time RDM is opened after this, show a notification explaining that a
reload is needed to apply certain emulation features.
MozReview-Commit-ID: 26GMbhT5MUo
--HG--
extra : rebase_source : 069ab687830faf29e5fe37b408628c0cd85e1464
This adds a menu to the RDM global toolbar to allow the user to control whether
the page reloads in response to various state changes.
This also changes the default behavior to _not_ reload, so that we avoid losing
changes that might have been made in DevTools.
MozReview-Commit-ID: 86h5cB5dify
--HG--
extra : rebase_source : ebb4f86da4407772704a9fc06b4083b39cf61290
The first time RDM is opened after this, show a notification explaining that a
reload is needed to apply certain emulation features.
MozReview-Commit-ID: 26GMbhT5MUo
--HG--
extra : rebase_source : 6b043a6465687ccae23eb2cf0619b3e82ca62c5f
This adds a menu to the RDM global toolbar to allow the user to control whether
the page reloads in response to various state changes.
This also changes the default behavior to _not_ reload, so that we avoid losing
changes that might have been made in DevTools.
MozReview-Commit-ID: 86h5cB5dify
--HG--
extra : rebase_source : 0d1598bd0ad066eaffdc23d4c970c64f368afa04
We also add a test to make sure we have the expected context menu
on log and network message in the browser console.
MozReview-Commit-ID: E2woQj5clJF
--HG--
extra : rebase_source : a3de488ed61e8124ad743983eeb23791df911716
Currently, if you open the Inspector on some page, then enter RDM, the Inspector
will "reboot" (reload all panels) because it believes the document has reloaded.
However, it's not really true in this case. Instead, it's an artifact of the
pagehide / pageshow events that are triggered when swapping frames like RDM
does. Bug 1438697 adds a chrome-only property that we then use here to
distinguish this case.
MozReview-Commit-ID: Ks42QayVnij
--HG--
extra : rebase_source : 91739a5db2774073e723b1daf43bc5242755fc43
The browser console test for imminent distrust relies upon certs inserted
into build/pgo/certs/cert8.db and key3.db [1], and seemed angry when adding new
certs with certutil bumping those to cert9 and key4 formats. Since time is
getting to be of-the-essence with Bug 1434300, I've filed Bug 1439378 to re-
enable this test post-landing.
[1] https://hg.mozilla.org/mozilla-central/rev/98b1272e170c
MozReview-Commit-ID: I4SIiqc5AqH
--HG--
extra : rebase_source : 06295cbed14f2a793162073e707e14026ea69625
We weren't doing the right transform for cached messages, and thus
we weren't creating the ConsoleMessage with the correct properties.
This is now fixed and a mocha test is added to make sure we don't
regress on this.
MozReview-Commit-ID: ACOCPF06GK2
--HG--
extra : rebase_source : 029fe31b7343f4032ea48a8629bae8d8c0a87e62
It is totally valid to declare an empty style in styled console.log.
But we were appending a space after a string with empty style because
we were checking that the style wasn't falsy, and empty string is falsy.
We fix that by checking against undefined.
A test is added to make sure we don't regress that.
MozReview-Commit-ID: EOQ49Gt0Cr9
--HG--
extra : rebase_source : bf711afa76dd784d3cf1f973c47e4aa139d5bc5e
In the old frontend `this.window.close` worked since webconsole.xul was used for both the web console
and browser console. The new frontend is implemented in HTML (webconsole.html) but for the browser console
we wrap that in a XUL document (browserconsole.xul) to support window management and other XUL features.
So when the HTML frontend receieves cmd/ctrl+w, we now call the `close` function for the XUL window instead.
MozReview-Commit-ID: 5j9rimTC2f8
--HG--
extra : rebase_source : dc1b444b22a2c8214e4dbf21a3a4972be2249fc5
The browser console test for imminent distrust relies upon certs inserted
into build/pgo/certs/cert8.db and key3.db [1], and seemed angry when adding new
certs with certutil bumping those to cert9 and key4 formats. Since time is
getting to be of-the-essence with Bug 1434300, I've filed Bug 1439378 to re-
enable this test post-landing.
[1] https://hg.mozilla.org/mozilla-central/rev/98b1272e170c
MozReview-Commit-ID: I4SIiqc5AqH
--HG--
extra : rebase_source : 6cac70e494c284314bf62d2e0c856a0d9a98831e
Track connection status at various points during Browser Toolbox startup. If
connecting takes a long time or triggers an error, the status panel is revealed
with the most recent message displayed.
MozReview-Commit-ID: H8240rv3KRe
--HG--
extra : rebase_source : 7c2c10c710095ede7d1b9c1ac87ca21bd3deb969
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