| /third_party/node/test/async-hooks/ |
| D | test-http-agent-handle-reuse-parallel.js | 2 // Flags: --expose-internals 3 const common = require('../common'); constant 4 const initHooks = require('./init-hooks'); 5 const { checkInvocations } = require('./hook-checks'); 6 const assert = require('assert'); 7 const { async_id_symbol } = require('internal/async_hooks').symbols; 8 const http = require('http'); 11 // is not reused. Test is based on parallel\test-async-hooks-http-agent.js. 37 res.on('data', common.mustCallAtLeast()); 38 res.on('end', common.mustCall(() => { [all …]
|
| D | test-http-agent-handle-reuse-serial.js | 2 // Flags: --expose-internals 3 const common = require('../common'); constant 4 const initHooks = require('./init-hooks'); 5 const { checkInvocations } = require('./hook-checks'); 6 const assert = require('assert'); 7 const { async_id_symbol } = require('internal/async_hooks').symbols; 8 const http = require('http'); 11 // is not reused. Test is based on parallel\test-async-hooks-http-agent.js. 26 const server = http.createServer(common.mustCall((req, res) => { 27 req.once('data', common.mustCallAtLeast(() => { [all …]
|
| D | test-signalwrap.js | 2 const common = require('../common'); constant 4 if (common.isWindows) 5 common.skip('no signals in Windows'); 6 if (!common.isMainThread) 7 common.skip('No signal handling available in Workers'); 9 const assert = require('assert'); 10 const initHooks = require('./init-hooks'); 11 const { checkInvocations } = require('./hook-checks'); 12 const exec = require('child_process').exec; 21 process.on('SIGUSR2', common.mustCall(onsigusr2, 2)); [all …]
|
| D | test-timers.setTimeout.js | 3 const common = require('../common'); constant 4 const assert = require('assert'); 5 const tick = require('../common/tick'); 6 const initHooks = require('./init-hooks'); 7 const { checkInvocations } = require('./hook-checks'); 8 const TIMEOUT = common.platformTimeout(100); 13 // Install first timeout 14 setTimeout(common.mustCall(ontimeout), TIMEOUT); 21 checkInvocations(t1, { init: 1 }, 't1: when first timer installed'); 26 checkInvocations(t1, { init: 1, before: 1 }, 't1: when first timer fired'); [all …]
|
| D | test-statwatcher.js | 3 const common = require('../common'); constant 4 const tmpdir = require('../common/tmpdir'); 5 const assert = require('assert'); 6 const initHooks = require('./init-hooks'); 7 const { checkInvocations } = require('./hook-checks'); 8 const fs = require('fs'); 9 const path = require('path'); 11 if (!common.isMainThread) 12 common.skip('Worker bootstrapping works differently -> different async IDs'); 36 // Install first file watcher. [all …]
|
| D | test-immediate.js | 3 const common = require('../common'); constant 4 const assert = require('assert'); 5 const tick = require('../common/tick'); 6 const initHooks = require('./init-hooks'); 7 const { checkInvocations } = require('./hook-checks'); 12 // Install first immediate 13 setImmediate(common.mustCall(onimmediate)); 22 'imd1: when first set immediate installed'); 30 'imd1: when first set immediate triggered'); 33 setImmediate(common.mustCall(onimmediateTwo));
|
| D | test-enable-disable.js | 17 // invocations until then, including the "init" and "before" of the first 19 // However afterwards it collects all invocations that follow on the first 48 // - setting up first Immediate 49 // hook1.init.uid-5 50 // hook3.init.uid-5 51 // - finished setting first Immediate 53 // hook1.before.uid-5 54 // hook3.before.uid-5 55 // - enabled hook2 56 // - entering onfirstImmediate [all …]
|
| /third_party/node/test/sequential/ |
| D | test-diagnostic-dir-heap-prof.js | 3 // This test is to ensure that --diagnostic-dir does not change the directory 4 // for --cpu-prof when --cpu-prof-dir is specified 6 const common = require('../common'); constant 7 const fixtures = require('../common/fixtures'); 8 common.skipIfInspectorDisabled(); 10 const assert = require('assert'); 11 const fs = require('fs'); 12 const path = require('path'); 13 const { spawnSync } = require('child_process'); 15 const tmpdir = require('../common/tmpdir'); [all …]
|
| D | test-tls-session-timeout.js | 23 const common = require('../common'); constant 25 if (!common.opensslCli) 26 common.skip('node compiled without OpenSSL CLI.'); 28 if (!common.hasCrypto) 29 common.skip('missing crypto'); 31 const tmpdir = require('../common/tmpdir'); 36 // This test consists of three TLS requests -- 37 // * The first one should result in a new connection because we don't have 40 // the session ticket we saved from the first connection. 45 const assert = require('assert'); [all …]
|
| /third_party/node/test/parallel/ |
| D | test-eslint-require-common-first.js | 3 const common = require('../common'); constant 4 if ((!common.hasCrypto) || (!common.hasIntl)) { 5 common.skip('ESLint tests require crypto and Intl'); 8 common.skipIfEslintMissing(); 10 const RuleTester = require('../../tools/node_modules/eslint').RuleTester; 11 const rule = require('../../tools/eslint-rules/require-common-first'); 13 new RuleTester().run('require-common-first', rule, { 16 code: 'require("common")\n' + 17 'require("assert")' 22 code: 'require("assert")\n' + [all …]
|
| D | test-https-agent-session-reuse.js | 2 const common = require('../common'); constant 3 const assert = require('assert'); 5 if (!common.hasCrypto) 6 common.skip('missing crypto'); 8 const https = require('https'); 9 const crypto = require('crypto'); 10 const fixtures = require('../common/fixtures'); 13 key: fixtures.readKey('agent1-key.pem'), 14 cert: fixtures.readKey('agent1-cert.pem') 17 const ca = fixtures.readKey('ca1-cert.pem'); [all …]
|
| D | test-worker-broadcastchannel-wpt.js | 3 const common = require('../common'); constant 4 const assert = require('assert'); 7 } = require('worker_threads'); 13 c2.onmessage = common.mustCall((e) => { 30 // first, then c2, then c3. In the Node.js dispatching 39 // Whereas in the browser-ordering (as illustrated in the 53 const handler = common.mustCall((e) => { 61 if (!common.isWindows) { 90 c2.onmessage = common.mustNotCall(); 92 c3.onmessage = common.mustCall(() => c3.close()); [all …]
|
| D | test-v8-coverage.js | 5 const common = require('../common'); constant 6 const assert = require('assert'); 7 const fs = require('fs'); 8 const path = require('path'); 9 const { spawnSync } = require('child_process'); 11 const tmpdir = require('../common/tmpdir'); 23 require.resolve('../fixtures/v8-coverage/basic'), 32 // First branch executed. 38 // Outputs coverage when error is thrown in first tick. 42 require.resolve('../fixtures/v8-coverage/throw'), [all …]
|
| D | test-trace-events-binding.js | 2 const common = require('../common'); constant 3 const assert = require('assert'); 4 const cp = require('child_process'); 5 const fs = require('fs'); 6 const path = require('path'); 9 const { internalBinding } = require('internal/test/binding'); 12 'type-value', 10, {'extra-value': 20 }); 14 'type-value', 20, {'first-value': 20, 'second-value': 30 }); 15 trace('b'.charCodeAt(0), 'custom', 'type-value', 30); 17 'type-value', 10, {'extra-value': 20 }); [all …]
|
| D | test-https-agent-session-eviction.js | 1 // Flags: --tls-min-v1.0 4 const common = require('../common'); constant 5 const { readKey } = require('../common/fixtures'); 7 if (!common.hasCrypto) 8 common.skip('missing crypto'); 10 const https = require('https'); 11 const { SSL_OP_NO_TICKET } = require('crypto').constants; 14 key: readKey('agent1-key.pem'), 15 cert: readKey('agent1-cert.pem'), 24 first(this); [all …]
|
| D | test-zlib-from-concatenated-gzip.js | 4 const common = require('../common'); constant 5 const assert = require('assert'); 6 const zlib = require('zlib'); 7 const fs = require('fs'); 8 const fixtures = require('../common/fixtures'); 23 zlib.gunzip(data, common.mustSucceed((result) => { 27 zlib.unzip(data, common.mustSucceed((result) => { 31 // Multi-member support does not apply to zlib inflate/deflate. 35 ]), common.mustSucceed((result) => { 42 const pmmFileZlib = fixtures.path('pseudo-multimember-gzip.z'); [all …]
|
| D | test-sync-io-option.js | 2 const common = require('../common'); constant 3 const assert = require('assert'); 4 const { promisify } = require('util'); 5 const execFile = promisify(require('child_process').execFile); 7 // Test that --trace-sync-io works. In particular, a warning should be printed 8 // when it is enabled and synchronous I/O happens after the first event loop 10 // happens before the first event loop turn is over. 12 if (process.argv[2] === 'late-sync-io') { 14 require('fs').statSync(__filename); 17 } else if (process.argv[2] === 'early-sync-io') { [all …]
|
| D | test-net-autoselectfamily-ipv4first.js | 3 const common = require('../common'); constant 4 const { parseDNSPacket, writeDNSPacket } = require('../common/dns'); 6 const assert = require('assert'); 7 const dgram = require('dgram'); 8 const { Resolver } = require('dns'); 9 const { createConnection, createServer, setDefaultAutoSelectFamilyAttemptTimeout } = require('net'); 11 // Test that happy eyeballs algorithm is properly implemented when a A record is returned first. 14 setDefaultAutoSelectFamilyAttemptTimeout(common.platformTimeout(common.isWindows ? 1500 : 250)); 39 socket.on('message', common.mustCall((msg, { address, port }) => { 62 // Test that IPV6 is NOT reached if IPV4 is sorted first [all …]
|
| D | test-stream-pipe-await-drain.js | 2 const common = require('../common'); constant 3 const stream = require('stream'); 4 const assert = require('assert'); 6 // This is very similar to test-stream-pipe-cleanup-pause.js. 20 writer1._write = common.mustCall(function(chunk, encoding, cb) { 21 this.emit('chunk-received'); 25 writer1.once('chunk-received', () => { 40 writer2._write = common.mustCall((chunk, encoding, cb) => { 44 'awaitDrain should be 1 after first push, actual is ' + 48 // This should be called exactly once, since the first .write() call [all …]
|
| D | test-net-listen-invalid-port.js | 2 const common = require('../common'); constant 8 const assert = require('assert'); 9 const net = require('net'); 11 const invalidPort = -1 >>> 0; 15 const key = `${address.family.slice(-1)}:${address.address}:0`; 21 // The first argument is a configuration object 23 net.Server().listen({ port: invalidPort }, common.mustNotCall()); 29 // The first argument is the port, no IP given. 31 net.Server().listen(invalidPort, common.mustNotCall()); 37 // The first argument is the port, the second an IP. [all …]
|
| D | test-tls-socket-default-options.js | 2 const common = require('../common'); constant 3 const fixtures = require('../common/fixtures'); 7 const assert = require('assert'); 10 } = require(fixtures.path('tls-connect')); 13 assert.strictEqual(err.message, 'unable to verify the first certificate'); 17 assert.strictEqual(err.message, 'unable to verify the first certificate'); 34 'unable to verify the first certificate'); 38 callback = common.mustCall(callback); 45 assert.strictEqual(err.message, 'unable to verify the first certificate'); 47 pair.server.server.once('secureConnection', common.mustCall((conn) => { [all …]
|
| D | test-runner-concurrency.js | 2 const common = require('../common'); constant 3 const tmpdir = require('../common/tmpdir'); 4 const fixtures = require('../common/fixtures'); 5 const { describe, it, test } = require('node:test'); 6 const assert = require('node:assert'); 7 const path = require('node:path'); 8 const fs = require('node:fs/promises'); 9 const os = require('node:os'); 10 const timers = require('node:timers/promises'); 16 it('should start the first test', () => new Promise((resolve) => { [all …]
|
| D | test-http-response-multiheaders.js | 3 const common = require('../common'); constant 4 const http = require('http'); 5 const assert = require('assert'); 6 const Countdown = require('../common/countdown'); 9 // 'content-length' should also be in this list but it is 10 // handled differently because multiple content-lengths are 11 // an error (see test-http-response-multi-content-length.js). 13 'content-type', 14 'user-agent', 18 'proxy-authorization', [all …]
|
| /third_party/node/test/abort/ |
| D | test-addon-uv-handle-leak.js | 2 const common = require('../common'); constant 3 const assert = require('assert'); 4 const fs = require('fs'); 5 const path = require('path'); 6 const cp = require('child_process'); 7 const { spawnSync } = require('child_process'); 9 // This is a sibling test to test/addons/uv-handle-leak. 12 __dirname, '..', 'addons', 'uv-handle-leak', 'build', 13 `${common.buildType}/binding.node`); 16 common.skip('binding not built yet'); [all …]
|
| /third_party/node/test/common/ |
| D | README.md | 1 # Node.js Core Test Common Modules 7 * [ArrayStream module](#arraystream-module) 8 * [Benchmark module](#benchmark-module) 9 * [Child process module](#child-process-module) 10 * [Common module API](#common-module-api) 11 * [Countdown module](#countdown-module) 12 * [CPU Profiler module](#cpu-profiler-module) 13 * [Debugger module](#debugger-module) 14 * [DNS module](#dns-module) 15 * [Duplex pair helper](#duplex-pair-helper) [all …]
|