diff options
author | Kirill Fomichev <fanatid@ya.ru> | 2019-09-04 23:01:07 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-09-07 07:04:19 -0700 |
commit | ef9ecfbcfe8a5b1e8b1c601c48afa065cbdab614 (patch) | |
tree | 85499d4556af71392e2f889b26619aa8d4e74f5f /test | |
parent | 6d01f1fa41947dc2ea087611ed443616b757fef8 (diff) | |
download | android-node-v8-ef9ecfbcfe8a5b1e8b1c601c48afa065cbdab614.tar.gz android-node-v8-ef9ecfbcfe8a5b1e8b1c601c48afa065cbdab614.tar.bz2 android-node-v8-ef9ecfbcfe8a5b1e8b1c601c48afa065cbdab614.zip |
perf_hooks: ignore duplicated entries in observer
PerformanceObserver should add to observing only unique entry types.
PR-URL: https://github.com/nodejs/node/pull/29442
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-performanceobserver.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/parallel/test-performanceobserver.js b/test/parallel/test-performanceobserver.js index 513d7db220..75097cb8c7 100644 --- a/test/parallel/test-performanceobserver.js +++ b/test/parallel/test-performanceobserver.js @@ -62,6 +62,12 @@ assert.strictEqual(counts[NODE_PERFORMANCE_ENTRY_TYPE_FUNCTION], 0); 'for option "entryTypes"' }); }); + + const obs = new PerformanceObserver(common.mustNotCall()); + obs.observe({ entryTypes: ['mark', 'mark'] }); + obs.disconnect(); + performance.mark('42'); + assert.strictEqual(counts[NODE_PERFORMANCE_ENTRY_TYPE_MARK], 0); } // Test Non-Buffered |