summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/common/index.js4
-rw-r--r--test/parallel/test-bootstrap-modules.js2
-rw-r--r--test/parallel/test-global.js1
-rw-r--r--test/parallel/test-navigator.js16
4 files changed, 23 insertions, 0 deletions
diff --git a/test/common/index.js b/test/common/index.js
index f3caa9d1d4..7a38c44322 100644
--- a/test/common/index.js
+++ b/test/common/index.js
@@ -308,6 +308,10 @@ if (global.gc) {
knownGlobals.push(global.gc);
}
+if (global.navigator) {
+ knownGlobals.push(global.navigator);
+}
+
if (global.Performance) {
knownGlobals.push(global.Performance);
}
diff --git a/test/parallel/test-bootstrap-modules.js b/test/parallel/test-bootstrap-modules.js
index 0a671eb95e..32f90905b6 100644
--- a/test/parallel/test-bootstrap-modules.js
+++ b/test/parallel/test-bootstrap-modules.js
@@ -46,6 +46,8 @@ const expectedModules = new Set([
'NativeModule async_hooks',
'NativeModule internal/process/task_queues',
'NativeModule timers',
+ 'Internal Binding os',
+ 'NativeModule internal/navigator',
'Internal Binding trace_events',
'NativeModule internal/constants',
'NativeModule path',
diff --git a/test/parallel/test-global.js b/test/parallel/test-global.js
index 9ac9b4f728..3fd9a3f6f5 100644
--- a/test/parallel/test-global.js
+++ b/test/parallel/test-global.js
@@ -49,6 +49,7 @@ builtinModules.forEach((moduleName) => {
'clearImmediate',
'clearInterval',
'clearTimeout',
+ 'navigator',
'atob',
'btoa',
'performance',
diff --git a/test/parallel/test-navigator.js b/test/parallel/test-navigator.js
new file mode 100644
index 0000000000..ba760846bb
--- /dev/null
+++ b/test/parallel/test-navigator.js
@@ -0,0 +1,16 @@
+'use strict';
+
+require('../common');
+const assert = require('assert');
+const { platform } = require('process');
+
+assert.strictEqual(navigator.platform, {
+ aix: 'AIX',
+ android: 'Android',
+ darwin: 'MacIntel',
+ freebsd: 'FreeBSD',
+ linux: 'Linux',
+ openbsd: 'OpenBSD',
+ sunos: 'SunOS',
+ win32: 'Win32',
+}[platform]);