diff options
author | James M Snell <jasnell@gmail.com> | 2018-08-06 12:28:33 -0700 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2018-08-09 11:12:35 -0700 |
commit | c1e2d6b0f16568f1a115feab071adf41de72c72d (patch) | |
tree | 3195a0efdda7460c5a73b0891ead2abcff337797 /test | |
parent | 9f5cc1fc92918c387ec007944b5a53566b428adb (diff) | |
download | android-node-v8-c1e2d6b0f16568f1a115feab071adf41de72c72d.tar.gz android-node-v8-c1e2d6b0f16568f1a115feab071adf41de72c72d.tar.bz2 android-node-v8-c1e2d6b0f16568f1a115feab071adf41de72c72d.zip |
trace_events: move trace_events to internalBinding
PR-URL: https://github.com/nodejs/node/pull/22159
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-trace-events-binding.js | 23 | ||||
-rw-r--r-- | test/parallel/test-trace-events-category-used.js | 18 |
2 files changed, 24 insertions, 17 deletions
diff --git a/test/parallel/test-trace-events-binding.js b/test/parallel/test-trace-events-binding.js index 7ce75ace33..2544c196ac 100644 --- a/test/parallel/test-trace-events-binding.js +++ b/test/parallel/test-trace-events-binding.js @@ -8,18 +8,16 @@ if (!common.isMainThread) common.skip('process.chdir is not available in Workers'); const CODE = ` - process.binding("trace_events").emit( - 'b'.charCodeAt(0), 'custom', - 'type-value', 10, 'extra-value', 20); - process.binding("trace_events").emit( - 'b'.charCodeAt(0), 'custom', - 'type-value', 20, 'first-value', 20, 'second-value', 30); - process.binding("trace_events").emit( - 'b'.charCodeAt(0), 'custom', - 'type-value', 30); - process.binding("trace_events").emit( - 'b'.charCodeAt(0), 'missing', - 'type-value', 10, 'extra-value', 20); + const { internalBinding } = require('internal/test/binding'); + const { emit } = internalBinding('trace_events'); + emit('b'.charCodeAt(0), 'custom', + 'type-value', 10, 'extra-value', 20); + emit('b'.charCodeAt(0), 'custom', + 'type-value', 20, 'first-value', 20, 'second-value', 30); + emit('b'.charCodeAt(0), 'custom', + 'type-value', 30); + emit('b'.charCodeAt(0), 'missing', + 'type-value', 10, 'extra-value', 20); `; const FILE_NAME = 'node_trace.1.log'; @@ -29,6 +27,7 @@ process.chdir(tmpdir.path); const proc = cp.spawn(process.execPath, [ '--trace-event-categories', 'custom', + '--expose-internals', '-e', CODE ]); proc.once('exit', common.mustCall(() => { diff --git a/test/parallel/test-trace-events-category-used.js b/test/parallel/test-trace-events-category-used.js index d5aff4e136..4f9ad69366 100644 --- a/test/parallel/test-trace-events-category-used.js +++ b/test/parallel/test-trace-events-category-used.js @@ -6,9 +6,13 @@ const cp = require('child_process'); if (!common.isMainThread) common.skip('process.chdir is not available in Workers'); -const CODE = `console.log( - process.binding("trace_events").categoryGroupEnabled("custom") -);`; +const CODE = ` + const { internalBinding } = require('internal/test/binding'); + const { categoryGroupEnabled } = internalBinding('trace_events'); + console.log( + categoryGroupEnabled("custom") + ); +`; const tmpdir = require('../common/tmpdir'); tmpdir.refresh(); @@ -16,7 +20,9 @@ process.chdir(tmpdir.path); const procEnabled = cp.spawn( process.execPath, - [ '--trace-event-categories', 'custom', '-e', CODE ] + [ '--trace-event-categories', 'custom', + '--expose-internals', + '-e', CODE ] ); let procEnabledOutput = ''; @@ -28,7 +34,9 @@ procEnabled.once('exit', common.mustCall(() => { const procDisabled = cp.spawn( process.execPath, - [ '--trace-event-categories', 'other', '-e', CODE ] + [ '--trace-event-categories', 'other', + '--expose-internals', + '-e', CODE ] ); let procDisabledOutput = ''; |