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

Unified Diff: tests/html/element_test.dart

Issue 13852008: Removing redundant collection methods from DOM collections. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « sdk/lib/html/html_common/filtered_element_list.dart ('k') | tests/html/node_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/element_test.dart
diff --git a/tests/html/element_test.dart b/tests/html/element_test.dart
index f9531296d91a9320af1555677f357b6aa5cab347..aae4dda3510372eff6f875eaa75b4cabc00a6499 100644
--- a/tests/html/element_test.dart
+++ b/tests/html/element_test.dart
@@ -18,6 +18,12 @@ expectLargeRect(Rect rect) {
expect(rect.right, rect.left + rect.width);
}
+void testUnsupported(String name, void f()) {
+ test(name, () {
+ expect(f, throwsUnsupportedError);
+ });
+}
+
main() {
useHtmlIndividualConfiguration();
@@ -488,6 +494,36 @@ main() {
var el = makeElementWithChildren();
expect(el.children.sublist(1, 2), isElementList);
});
+
+ test('getRange', () {
+ var el = makeElementWithChildren();
+ expect(el.children.getRange(1, 2).length, 1);
+ });
+
+ testUnsupported('sort', () {
+ var l = makeElementWithChildren().children;
+ l.sort();
+ });
+
+ testUnsupported('setRange', () {
+ var l = makeElementWithChildren().children;
+ l.setRange(0, 0, []);
+ });
+
+ testUnsupported('replaceRange', () {
+ var l = makeElementWithChildren().children;
+ l.replaceRange(0, 0, []);
+ });
+
+ testUnsupported('removeRange', () {
+ var l = makeElementWithChildren().children;
+ l.removeRange(0, 1);
+ });
+
+ testUnsupported('insertAll', () {
+ var l = makeElementWithChildren().children;
+ l.insertAll(0, []);
+ });
});
group('matches', () {
@@ -518,12 +554,6 @@ main() {
List<Element> getEmptyQueryAll() => new Element.tag('div').queryAll('img');
- void testUnsupported(String name, void f()) {
- test(name, () {
- expect(f, throwsUnsupportedError);
- });
- }
-
test('last', () {
expect(getQueryAll().last, isHRElement);
});
@@ -604,7 +634,9 @@ main() {
testUnsupported('sort', () => getQueryAll().sort((a1, a2) => true));
- testUnsupported('setRange', () => getQueryAll().setRange(0, 0, []));
+ testUnsupported('setRange', () {
+ getQueryAll().setRange(0, 1, [new BRElement()]);
+ });
testUnsupported('removeRange', () => getQueryAll().removeRange(0, 1));
« no previous file with comments | « sdk/lib/html/html_common/filtered_element_list.dart ('k') | tests/html/node_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698