summaryrefslogtreecommitdiff
path: root/test/cctest/test_inspector_socket.cc
AgeCommit message (Collapse)Author
2017-12-14test: remove unused disposed_ variableDaniel Bevenius
Currently building test_inspector_socket.cc generates the following warning: ../test/cctest/test_inspector_socket.cc:189:8: warning: private field 'disposed_' is not used [-Wunused-private-field] bool disposed_ = false; ^ 1 warning generated. This commit removes this variable. PR-URL: https://github.com/nodejs/node/pull/17628 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-12-11inspector: Fix crash for WS connectionEugene Ostroukhov
Attaching WS session will now include a roundtrip onto the main thread to make sure there is no other session (e.g. JS bindings) This change also required refactoring WS socket implementation to better support scenarios like this. Fixes: https://github.com/nodejs/node/issues/16852 PR-URL: https://github.com/nodejs/node/pull/17085 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-07-27src: replace ASSERT with CHECKBen Noordhuis
Builds always have asserts enabled so there is no point distinguishing between debug-only checks and run-time checks. Replace calls to ASSERT and friends with their CHECK counterparts. Fixes: https://github.com/nodejs/node/issues/14461 PR-URL: https://github.com/nodejs/node/pull/14474 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Nikolai Vavilov <vvnicholas@gmail.com> Reviewed-By: XadillaX <admin@xcoder.in>
2017-06-26test: check uv_ip4_addr return valueEugene Ostroukhov
Fixes Coverity errors. PR-URL: https://github.com/nodejs/node/pull/13878 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-06-01inspector: refactor to rename and comment methodsSam Roberts
Pure refactor, makes no functional changes but the renaming helped me see more clearly what the relationship was between methods and variables. * Renamed methods to reduce number of slightly different names for the same thing ("thread" vs "io thread", etc.). * Added comments where it was useful to me. PR-URL: https://github.com/nodejs/node/pull/13321 Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-05-12inspector: handle socket close before close frameEugene Ostroukhov
This change handles clients that respond to close request with a TCP close instead of close response. PR-URL: https://github.com/nodejs/node/pull/12937 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-12-14inspector: fix Coverity defectsEugene Ostroukhov
One defect remains - Coverity believes that a session object is never freed while in reality its lifespan is tied to a libuv socket. PR-URL: https://github.com/nodejs/node/pull/10240 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
2016-12-07test: check result of uv_loop_init and uv_writeBen Noordhuis
Silence coverity warnings about the return value not being checked. PR-URL: https://github.com/nodejs/node/pull/10126 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Eugene Ostroukhov <eostroukhov@chromium.org> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-12-01test: run cpplint on files in test/cctestBen Noordhuis
Enable cpplint for files in test/cctest. Fix up the style issues it reports. PR-URL: https://github.com/nodejs/node/pull/9787 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2016-10-13test: fix issues reported by CoverityEugene Ostroukhov
Wrapped the timer into class to ensure it is cleaned up properly. PR-URL: https://github.com/nodejs/node/pull/8870 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-10-03test: fix -Wformat warnings in inspector cctestBen Noordhuis
Print size_t and ssize_t using %zd and %zu respectively, not %ld. PR-URL: https://github.com/nodejs/node/pull/8034 Reviewed-By: James M Snell <jasnell@gmail.com>
2016-09-22inspector: wait for both sides closingEugene Ostroukhov
Removes race condition when test relied on both sides of the socket to be closed on the same UV event loop iteration. Fixes: nodejs/node#8498 PR-URL: https://github.com/nodejs/node/pull/8505 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-by: Fedor Indutny <fedor@indutny.com>
2016-09-20inspector: zero out structure membersEugene Ostroukhov
Ctor has to be added as memset to 0 is no longer an option, since the structure now has std::vector member. Attempt at fixing nodejs/node#8155 (so far I was not able to repro it) PR-URL: https://github.com/nodejs/node/pull/8536 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
2016-09-16inspector: fix tests on WindowsEugene Ostroukhov
Should help with https://github.com/nodejs/node/pull/8034. PR-URL: https://github.com/nodejs/node/pull/8528 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
2016-08-31inspector: simplify buffer managementEugene Ostroukhov
This change simplifies buffer management to address a number of issues that original implementation had. Original implementation was trying to reduce the number of allocations by providing regions of the internal buffer to libuv IO code. This introduced some potential use after free issues if the buffer grows (or shrinks) while there's a pending read. It also had some confusing math that resulted in issues on Windows version of the libuv. PR-URL: https://github.com/nodejs/node/pull/8257 Fixes: https://github.com/nodejs/node/issues/8155 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
2016-08-09test: fix failing inspector cctestEugene Ostroukhov
Test was updated to wait till the inspector processes socket closure. Fixes: https://github.com/nodejs/node/pull/8006 PR-URL: https://github.com/nodejs/node/pull/8019 Reviewed-By: ofrobots - Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
2016-08-01src: avoid manual memory management in inspectorBen Noordhuis
Make the inspector code easier to reason about by restructuring it to avoid manual memory allocation and copying as much as possible. An amusing side effect is that it reduces the total amount of memory used in the test suite. Before: $ valgrind ./out/Release/cctest 2>&1 | grep 'total heap' | cut -c31- 1,017 allocs, 1,017 frees, 21,695,456 allocated After: $ valgrind ./out/Release/cctest 2>&1 | grep 'total heap' | cut -c31- 869 allocs, 869 frees, 14,484,641 bytes allocated PR-URL: https://github.com/nodejs/node/pull/7906 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-01test: fix memory leaks in inspector testsBen Noordhuis
The inspector tests weren't closing open libuv handles properly, making valgrind complain. Strengthen the uv_loop_close() check while here. With this commit applied: $ valgrind ./out/Release/cctest 2>&1 | grep 'total heap' | cut -c31- 1,017 allocs, 1,017 frees, 21,695,456 bytes allocated PR-URL: https://github.com/nodejs/node/pull/7906 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-06-29inspector: Do cleanups before notifying callbackEugene Ostroukhov
Inspector socket implementation was notifying handshake callback before performing the cleanups, which meant that callback could not reclaim resources allocated by the client. New implementation will free all resource not allocated by the client before calling the callback, allowing the client to complete the cleanup. Fixes: https://github.com/nodejs/node/pull/7418 PR-URL: https://github.com/nodejs/node/pull/7450 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
2016-06-17inspector: fix inspector connection cleanupEugene Ostroukhov
In some cases close callback was called twice, while in some cases the memory was still not released at all. PR-URL: https://github.com/nodejs/node/pull/7268 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
2016-05-30src,lib: v8-inspector supportPavel Feldman
This change introduces experimental v8-inspector support. This brings the DevTools debug protocol allowing Node.js to be debugged with Chrome DevTools native, or through other debuggers supporting that protocol. Partial WebSocket support, to the extent required by DevTools, is included. This is derived from the implementation in Blink. v8-inspector support can be disabled by the --without-inspector configure flag. PR-URL: https://github.com/nodejs/node/pull/6792 Reviewed-By: jasnell - James M Snell <jasnell@gmail.com> Reviewed-By: addaleax - Anna Henningsen <anna@addaleax.net> Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>