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

Unified Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/resources/idlharness.js

Issue 1515563002: Import web-platform-tests@5dbe45af3ad3a933c03187c72f1c12cbe2877703 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/imported/web-platform-tests/resources/idlharness.js
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/resources/idlharness.js b/third_party/WebKit/LayoutTests/imported/web-platform-tests/resources/idlharness.js
index 9f324e089ebf72b97aa1b007adaabb846635c5b4..02304ca10600ac1e384bb3227e19a9531e3b3b9f 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/resources/idlharness.js
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/resources/idlharness.js
@@ -772,6 +772,30 @@ IdlInterface.prototype.test_self = function()
}.bind(this), this.name + " interface object length");
}
+ if (!this.is_callback() || this.has_constants()) {
+ test(function() {
+ // This function tests WebIDL as of 2015-11-17.
+ // https://heycam.github.io/webidl/#interface-object
+
+ assert_own_property(self, this.name,
+ "self does not have own property " + format_value(this.name));
+
+ // "All interface objects must have a property named “name” with
+ // attributes { [[Writable]]: false, [[Enumerable]]: false,
+ // [[Configurable]]: true } whose value is the identifier of the
+ // corresponding interface."
+
+ assert_own_property(self[this.name], "name");
+ var desc = Object.getOwnPropertyDescriptor(self[this.name], "name");
+ assert_false("get" in desc, this.name + ".name has getter");
+ assert_false("set" in desc, this.name + ".name has setter");
+ assert_false(desc.writable, this.name + ".name is writable");
+ assert_false(desc.enumerable, this.name + ".name is enumerable");
+ assert_true(desc.configurable, this.name + ".name is not configurable");
+ assert_equals(self[this.name].name, this.name, "wrong value for " + this.name + ".name");
+ }.bind(this), this.name + " interface object name");
+ }
+
// TODO: Test named constructors if I find any interfaces that have them.
test(function()
« no previous file with comments | « third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/scripting-1/the-script-element/script-text-xhtml.xhtml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698