summaryrefslogtreecommitdiff
path: root/test/parallel/test-trace-events-none.js
diff options
context:
space:
mode:
authorAli Ijaz Sheikh <ofrobots@google.com>2018-05-15 11:52:18 -0700
committerAli Ijaz Sheikh <ofrobots@google.com>2018-05-18 10:42:35 -0700
commit3ff723f940c9b18f281131fad1d0c967c45169dd (patch)
tree65a93544c3db2d00227d2e8a0a5e8f471876087d /test/parallel/test-trace-events-none.js
parent42a4a606457e01df51943c9c1e68ceaf9cafa0fe (diff)
downloadandroid-node-v8-3ff723f940c9b18f281131fad1d0c967c45169dd.tar.gz
android-node-v8-3ff723f940c9b18f281131fad1d0c967c45169dd.tar.bz2
android-node-v8-3ff723f940c9b18f281131fad1d0c967c45169dd.zip
src: trace_events: support for metadata events
Add support for metadata events. At this point they are added to the main buffer. Emit a metadata event for the main thread. PR-URL: https://github.com/nodejs/node/pull/20757 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'test/parallel/test-trace-events-none.js')
-rw-r--r--test/parallel/test-trace-events-none.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/parallel/test-trace-events-none.js b/test/parallel/test-trace-events-none.js
index 6b60ce999a..a3f0338f28 100644
--- a/test/parallel/test-trace-events-none.js
+++ b/test/parallel/test-trace-events-none.js
@@ -2,6 +2,7 @@
const common = require('../common');
const assert = require('assert');
const cp = require('child_process');
+const fs = require('fs');
const CODE =
'setTimeout(() => { for (var i = 0; i < 100000; i++) { "test" + i } }, 1)';
@@ -17,5 +18,10 @@ const proc_no_categories = cp.spawn(
);
proc_no_categories.once('exit', common.mustCall(() => {
- assert(!common.fileExists(FILE_NAME));
+ assert(common.fileExists(FILE_NAME));
+ // Only __metadata categories should have been emitted.
+ fs.readFile(FILE_NAME, common.mustCall((err, data) => {
+ assert.ok(JSON.parse(data.toString()).traceEvents.every(
+ (trace) => trace.cat === '__metadata'));
+ }));
}));