summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/console/console-is-a-namespace.any.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /testing/web-platform/tests/console/console-is-a-namespace.any.js
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/console/console-is-a-namespace.any.js')
-rw-r--r--testing/web-platform/tests/console/console-is-a-namespace.any.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/testing/web-platform/tests/console/console-is-a-namespace.any.js b/testing/web-platform/tests/console/console-is-a-namespace.any.js
new file mode 100644
index 0000000000..1756ba6bc1
--- /dev/null
+++ b/testing/web-platform/tests/console/console-is-a-namespace.any.js
@@ -0,0 +1,28 @@
+// META: global=window,dedicatedworker,shadowrealm
+"use strict";
+// https://webidl.spec.whatwg.org/#es-namespaces
+// https://console.spec.whatwg.org/#console-namespace
+
+test(() => {
+ assert_true(self.hasOwnProperty("console"));
+}, "console exists on the global object");
+
+test(() => {
+ const propDesc = Object.getOwnPropertyDescriptor(self, "console");
+ assert_equals(propDesc.writable, true, "must be writable");
+ assert_equals(propDesc.enumerable, false, "must not be enumerable");
+ assert_equals(propDesc.configurable, true, "must be configurable");
+ assert_equals(propDesc.value, console, "must have the right value");
+}, "console has the right property descriptors");
+
+test(() => {
+ assert_false("Console" in self);
+}, "Console (uppercase, as if it were an interface) must not exist");
+
+test(() => {
+ const prototype1 = Object.getPrototypeOf(console);
+ const prototype2 = Object.getPrototypeOf(prototype1);
+
+ assert_equals(Object.getOwnPropertyNames(prototype1).length, 0, "The [[Prototype]] must have no properties");
+ assert_equals(prototype2, Object.prototype, "The [[Prototype]]'s [[Prototype]] must be %ObjectPrototype%");
+}, "The prototype chain must be correct");