| Index: sky/tests/dom/getChildElements.dart
|
| diff --git a/sky/tests/dom/getChildElements.dart b/sky/tests/dom/getChildElements.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c5ce427799fa8ceaec27fbf21fe867bb705f1b2e
|
| --- /dev/null
|
| +++ b/sky/tests/dom/getChildElements.dart
|
| @@ -0,0 +1,26 @@
|
| +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 doc = new Document();
|
| + var parent = doc.createElement('parent');
|
| + var child1 = doc.createElement('child1');
|
| + var child2 = doc.createElement('child1');
|
| + var grandchild = doc.createElement('grandchild');
|
| +
|
| + doc.appendChild(parent);
|
| + parent.appendChild(child1);
|
| + parent.appendChild(child2);
|
| + child1.appendChild(grandchild);
|
| +
|
| + var children = parent.getChildElements();
|
| + expect(children.length, equals(2));
|
| + expect(children[0], equals(child1));
|
| + expect(children[1], equals(child2));
|
| + });
|
| +}
|
|
|