mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
It was returing all element descendants instead of all element immediate children. R=eseidel@chromium.org Review URL: https://codereview.chromium.org/1048333006
26 lines
591 B
Plaintext
26 lines
591 B
Plaintext
<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> |