summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2018-08-09 13:44:44 -0700
committerJames M Snell <jasnell@gmail.com>2018-08-10 07:44:08 -0700
commitb85460498fc24b855efbc2516f8e7cc629e24bb6 (patch)
tree1be29060003b4b5b6fa0a827f550d62da9ab9f13 /test
parentc85933cbd07ec3e32fdb27c4c4ef1aeadc609345 (diff)
downloadandroid-node-v8-b85460498fc24b855efbc2516f8e7cc629e24bb6.tar.gz
android-node-v8-b85460498fc24b855efbc2516f8e7cc629e24bb6.tar.bz2
android-node-v8-b85460498fc24b855efbc2516f8e7cc629e24bb6.zip
src: remove old process.binding('trace_events').emit
Remove the older emit and categoryGroupEnabled bindings in favor of the new intrinsics PR-URL: https://github.com/nodejs/node/pull/22127 Reviewed-By: Andreas Madsen <amwebdk@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-trace-events-binding.js22
-rw-r--r--test/parallel/test-trace-events-category-used.js10
2 files changed, 19 insertions, 13 deletions
diff --git a/test/parallel/test-trace-events-binding.js b/test/parallel/test-trace-events-binding.js
index 2544c196ac..163d9c4cbd 100644
--- a/test/parallel/test-trace-events-binding.js
+++ b/test/parallel/test-trace-events-binding.js
@@ -9,15 +9,14 @@ if (!common.isMainThread)
const CODE = `
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 { trace } = internalBinding('trace_events');
+ trace('b'.charCodeAt(0), 'custom',
+ 'type-value', 10, {'extra-value': 20 });
+ trace('b'.charCodeAt(0), 'custom',
+ 'type-value', 20, {'first-value': 20, 'second-value': 30 });
+ trace('b'.charCodeAt(0), 'custom', 'type-value', 30);
+ trace('b'.charCodeAt(0), 'missing',
+ 'type-value', 10, {'extra-value': 20 });
`;
const FILE_NAME = 'node_trace.1.log';
@@ -27,6 +26,7 @@ process.chdir(tmpdir.path);
const proc = cp.spawn(process.execPath,
[ '--trace-event-categories', 'custom',
+ '--no-warnings',
'--expose-internals',
'-e', CODE ]);
@@ -42,14 +42,14 @@ proc.once('exit', common.mustCall(() => {
assert.strictEqual(traces[0].cat, 'custom');
assert.strictEqual(traces[0].name, 'type-value');
assert.strictEqual(traces[0].id, '0xa');
- assert.deepStrictEqual(traces[0].args, { 'extra-value': 20 });
+ assert.deepStrictEqual(traces[0].args.data, { 'extra-value': 20 });
assert.strictEqual(traces[1].pid, proc.pid);
assert.strictEqual(traces[1].ph, 'b');
assert.strictEqual(traces[1].cat, 'custom');
assert.strictEqual(traces[1].name, 'type-value');
assert.strictEqual(traces[1].id, '0x14');
- assert.deepStrictEqual(traces[1].args, {
+ assert.deepStrictEqual(traces[1].args.data, {
'first-value': 20,
'second-value': 30
});
diff --git a/test/parallel/test-trace-events-category-used.js b/test/parallel/test-trace-events-category-used.js
index 4f9ad69366..249ccd4aa3 100644
--- a/test/parallel/test-trace-events-category-used.js
+++ b/test/parallel/test-trace-events-category-used.js
@@ -8,9 +8,9 @@ if (!common.isMainThread)
const CODE = `
const { internalBinding } = require('internal/test/binding');
- const { categoryGroupEnabled } = internalBinding('trace_events');
+ const { isTraceCategoryEnabled } = internalBinding('trace_events');
console.log(
- categoryGroupEnabled("custom")
+ isTraceCategoryEnabled("custom")
);
`;
@@ -21,6 +21,9 @@ process.chdir(tmpdir.path);
const procEnabled = cp.spawn(
process.execPath,
[ '--trace-event-categories', 'custom',
+ // make test less noisy since internal/test/binding
+ // emits a warning.
+ '--no-warnings',
'--expose-internals',
'-e', CODE ]
);
@@ -35,6 +38,9 @@ procEnabled.once('exit', common.mustCall(() => {
const procDisabled = cp.spawn(
process.execPath,
[ '--trace-event-categories', 'other',
+ // make test less noisy since internal/test/binding
+ // emits a warning.
+ '--no-warnings',
'--expose-internals',
'-e', CODE ]
);