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

Unified Diff: tests/html/filteredelementlist_test.dart

Issue 1236793006: Fix type problem with FilteredElementList._iterable (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Review fixes Created 5 years, 5 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 | « sdk/lib/svg/dartium/svg_dartium.dart ('k') | tests/html/html.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/filteredelementlist_test.dart
diff --git a/tests/html/filteredelementlist_test.dart b/tests/html/filteredelementlist_test.dart
index 8f82ccec27b5a2d057e5a32360a490dcef26d145..b4110f74a5ca5e590e109cd4452922d33a25a6eb 100644
--- a/tests/html/filteredelementlist_test.dart
+++ b/tests/html/filteredelementlist_test.dart
@@ -91,4 +91,21 @@ main() {
expect(nodeList.childNodes[6], i2);
expect(nodeList.childNodes[7], d3);
});
+
+ test('FilteredElementList.insertAndRemove', () {
+ var emptyDiv = new DivElement();
+ var elementList = new FilteredElementList(emptyDiv);
+ expect(() => elementList[0], throwsA(isRangeError));
+ expect(() => elementList.insert(2, new BRElement()), throwsA(isRangeError));
+ var br = new BRElement();
+ elementList.insert(0, br);
+ expect(elementList.removeLast(), br);
+ elementList.add(br);
+ expect(elementList.remove(br), isTrue);
+ var br2 = new BRElement();
+ elementList.add(br);
+ expect(elementList.remove(br2), isFalse);
+ expect(elementList[0], br);
+ expect(() => elementList[1], throwsA(isRangeError));
+ });
}
« no previous file with comments | « sdk/lib/svg/dartium/svg_dartium.dart ('k') | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698