Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2019-12-09 05:53:02 +0300
committerJoyee Cheung <joyeec9h3@gmail.com>2019-12-20 17:10:13 +0300
commitc63d511c137130030c263fb98d0d261105244c08 (patch)
treeffda0e6de496ccb88080a5499ba55a2e28241ca2 /test
parent277f3436890fac87fe6b762abc00f59d36a9ec6f (diff)
bootstrap: use different scripts to setup different configurations
This patch splits the handling of `isMainThread` and `ownsProcessState` from conditionals in `lib/internal/bootstrap/node.js` into different scripts under `lib/internal/bootstrap/switches/`, and call them accordingly from C++ after `node.js` is run. This: - Creates a common denominator of the main thread and the worker thread bootstrap that can be snapshotted and shared by both. - Makes it possible to override the configurations on-the-fly. PR-URL: https://github.com/nodejs/node/pull/30862 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-bootstrap-modules.js6
-rw-r--r--test/parallel/test-dummy-stdio.js6
2 files changed, 6 insertions, 6 deletions
diff --git a/test/parallel/test-bootstrap-modules.js b/test/parallel/test-bootstrap-modules.js
index 55a989a9672..23d47c5e237 100644
--- a/test/parallel/test-bootstrap-modules.js
+++ b/test/parallel/test-bootstrap-modules.js
@@ -61,6 +61,7 @@ const expectedModules = new Set([
'NativeModule internal/process/execution',
'NativeModule internal/process/per_thread',
'NativeModule internal/process/promises',
+ 'NativeModule internal/process/signal',
'NativeModule internal/process/task_queues',
'NativeModule internal/process/warning',
'NativeModule internal/querystring',
@@ -79,10 +80,7 @@ const expectedModules = new Set([
'NativeModule vm',
]);
-if (common.isMainThread) {
- expectedModules.add('NativeModule internal/process/main_thread_only');
- expectedModules.add('NativeModule internal/process/stdio');
-} else {
+if (!common.isMainThread) {
expectedModules.add('Internal Binding messaging');
expectedModules.add('Internal Binding symbols');
expectedModules.add('Internal Binding worker');
diff --git a/test/parallel/test-dummy-stdio.js b/test/parallel/test-dummy-stdio.js
index 165c2c2c575..4866f85c7de 100644
--- a/test/parallel/test-dummy-stdio.js
+++ b/test/parallel/test-dummy-stdio.js
@@ -9,8 +9,10 @@ if (common.isWindows)
function runTest(fd, streamName, testOutputStream, expectedName) {
const result = child_process.spawnSync(process.execPath, [
'--expose-internals',
- '-e', `
- require('internal/process/stdio').resetStdioForTesting();
+ '--no-warnings',
+ '-e',
+ `const { internalBinding } = require('internal/test/binding');
+ internalBinding('process_methods').resetStdioForTesting();
fs.closeSync(${fd});
const ctorName = process.${streamName}.constructor.name;
process.${testOutputStream}.write(ctorName);