Revision 273bb41376c98c36e743186b63ec3cffa58a5339 authored by Ovidio Henriquez on 23 March 2018, 15:12:10 UTC, committed by Blink WPT Bot on 23 March 2018, 15:30:21 UTC
This change allows the removal of a descriptor to be simulated by the
Bluetooth test interface. A generated test script was also converted to test the
new interface.

BUG=569709

Change-Id: Id4286a3e44cd04ee1b371938f1ef89f33458269c
Reviewed-on: https://chromium-review.googlesource.com/972334
Reviewed-by: Giovanni Ortuño Urquidi <ortuno@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Conley Owens <cco3@chromium.org>
Commit-Queue: Ovidio Henriquez <odejesush@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545448}
1 parent 2d1fd9e
Raw File
console-is-a-namespace.any.js
"use strict";
// https://heycam.github.io/webidl/#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");
back to top