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

Unified Diff: sky/tests/dom/getChildElements.sky

Issue 1048333006: Fix getChildElements. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 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 | « sky/engine/core/dom/ContainerNode.cpp ('k') | sky/tests/dom/getChildElements-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tests/dom/getChildElements.sky
diff --git a/sky/tests/dom/getChildElements.sky b/sky/tests/dom/getChildElements.sky
new file mode 100644
index 0000000000000000000000000000000000000000..39c257f8cfa1c7bdc22af81263a39b85799ccef5
--- /dev/null
+++ b/sky/tests/dom/getChildElements.sky
@@ -0,0 +1,26 @@
+<parent>
+ <child1>
+ <grandchild />
+ </child1>
+ <child2 />
+</parent>
+
+<script>
+import "../resources/third_party/unittest/unittest.dart";
+import "../resources/unit.dart";
+
+import "dart:sky";
+
+void main() {
+ initUnit();
+
+ test("getChildElements should only include immediate children", () {
+ var parent = document.querySelector('parent');
+ var children = parent.getChildElements();
+ expect(children.length, equals(2));
+ expect(children[0], equals(document.querySelector('child1')));
+ expect(children[1], equals(document.querySelector('child2')));
+ });
+}
+</script>
+</sky>
« no previous file with comments | « sky/engine/core/dom/ContainerNode.cpp ('k') | sky/tests/dom/getChildElements-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698