Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/console/console-is-a-namespace.any.js

Issue 2446483002: Import wpt@c5a14f553cba5f197743b9af605a84eddd8692a2 (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 "use strict";
2 // https://heycam.github.io/webidl/#es-namespaces
3 // https://console.spec.whatwg.org/#console-namespace
4
5 test(() => {
6 assert_true(self.hasOwnProperty("console"));
7 }, "console exists on the global object");
8
9 test(() => {
10 const propDesc = Object.getOwnPropertyDescriptor(self, "console");
11 assert_equals(propDesc.writable, true, "must be writable");
12 assert_equals(propDesc.enumerable, false, "must not be enumerable");
13 assert_equals(propDesc.configurable, true, "must be configurable");
14 assert_equals(propDesc.value, console, "must have the right value");
15 }, "console has the right property descriptors");
16
17 test(() => {
18 assert_false("Console" in self);
19 }, "Console (uppercase, as if it were an interface) must not exist");
20
21 test(() => {
22 const prototype1 = Object.getPrototypeOf(console);
23 const prototype2 = Object.getPrototypeOf(prototype1);
24
25 assert_equals(Object.getOwnPropertyNames(prototype1).length, 0, "The [[Prototy pe]] must have no properties");
26 assert_equals(prototype2, Object.prototype, "The [[Prototype]]'s [[Prototype]] must be %ObjectPrototype%");
27 }, "The prototype chain must be correct");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698