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

Unified Diff: third_party/WebKit/LayoutTests/bindings/pair-iterators.html

Issue 2777183004: Make pair iterators inherit from %IteratorPrototype%. (Closed)
Patch Set: Fix the build after The Blink Rename Created 3 years, 8 months 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/external/wpt/fetch/api/headers/headers-basic-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/bindings/pair-iterators.html
diff --git a/third_party/WebKit/LayoutTests/bindings/pair-iterators.html b/third_party/WebKit/LayoutTests/bindings/pair-iterators.html
new file mode 100644
index 0000000000000000000000000000000000000000..0cb7632b189442ec016760f1b8d58c24d28140b9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/bindings/pair-iterators.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script>
+ test(() => {
+ // Headers.idl has an iterable<k, v> declaration.
+ let iterator = new Headers().entries();
+ let iteratorProto = Object.getPrototypeOf(iterator);
+ let iteratorProtoProto = Object.getPrototypeOf(iteratorProto);
+
+ assert_array_equals(Object.getOwnPropertyNames(iterator), [],
+ "The default iterator object has no properties of its own.");
+ assert_array_equals(Object.getOwnPropertySymbols(iterator), [],
+ "The default iterator object has no symbols of its own.");
+
+ assert_in_array("next", Object.getOwnPropertyNames(iteratorProto),
+ "The iterator prototype object has a property called 'next'.");
+ let nextProperty = Object.getOwnPropertyDescriptor(iteratorProto, "next");
+ assert_true(nextProperty.configurable, "The 'next' property must be configurable.");
+ assert_true(nextProperty.enumerable, "The 'next' property must be enumerable.");
+ assert_true(nextProperty.writable, "The 'next' property must be writable.");
+
+ assert_equals(iteratorProtoProto,
+ Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())),
+ "The iterator prototype object's [[Prototype]] is %IteratorPrototype.");
+ assert_array_equals(Object.getOwnPropertyNames(iteratorProtoProto), [],
+ "%IteratorPrototype% has no properties of its own");
+ assert_array_equals(Object.getOwnPropertySymbols(iteratorProtoProto),
+ [Symbol.iterator],
+ "%IteratorPrototype% has defines @@iterator.");
+ assert_equals(Object.getPrototypeOf(iteratorProtoProto), Object.prototype,
+ "%IteratorPrototype% descends from %ObjectPrototype%.");
+ }, "Iterators from pair-iterable interfaces inherit from %IteratorPrototype%");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/external/wpt/fetch/api/headers/headers-basic-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698