OLD | NEW |
1 #library("dom_query_html"); | 1 #library("dom_query_html"); |
2 #import("dart:html"); | 2 #import("dart:html"); |
3 #import('../common/common.dart'); | 3 #import('../common/common.dart'); |
4 #import("dart:math", prefix: "Math"); | 4 #import("dart:math", prefix: "Math"); |
5 #source("Common.dart"); | 5 #source("Common.dart"); |
6 #source("RunnerSuite.dart"); | 6 #source("RunnerSuite.dart"); |
7 | 7 |
8 void main() { | 8 void main() { |
9 final int num = 40; | 9 final int num = 40; |
10 | 10 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 }) | 69 }) |
70 .test('getElementsByTagName(*)', () { | 70 .test('getElementsByTagName(*)', () { |
71 for (int i = 0; i < num; i++) { | 71 for (int i = 0; i < num; i++) { |
72 List<Element> elems = document.queryAll('*'); | 72 List<Element> elems = document.queryAll('*'); |
73 ret = elems.last().$dom_nodeType; | 73 ret = elems.last().$dom_nodeType; |
74 } | 74 } |
75 }) | 75 }) |
76 .test('getElementsByTagName (not in document)', () { | 76 .test('getElementsByTagName (not in document)', () { |
77 for (int i = 0; i < num; i++) { | 77 for (int i = 0; i < num; i++) { |
78 List<Element> elems = document.queryAll('strong'); | 78 List<Element> elems = document.queryAll('strong'); |
79 ret = elems.isEmpty(); | 79 ret = elems.isEmpty; |
80 } | 80 } |
81 }) | 81 }) |
82 .test('getElementsByName', () { | 82 .test('getElementsByName', () { |
83 for (int i = 0; i < num * 20; i++) { | 83 for (int i = 0; i < num * 20; i++) { |
84 List<Element> elems = document.queryAll('[name="test$num"]'); | 84 List<Element> elems = document.queryAll('[name="test$num"]'); |
85 ret = elems.last().$dom_nodeType; | 85 ret = elems.last().$dom_nodeType; |
86 elems = document.queryAll('[name="test$num"]'); | 86 elems = document.queryAll('[name="test$num"]'); |
87 ret = elems.last().$dom_nodeType; | 87 ret = elems.last().$dom_nodeType; |
88 elems = document.queryAll('[name="test$num"]'); | 88 elems = document.queryAll('[name="test$num"]'); |
89 ret = elems.last().$dom_nodeType; | 89 ret = elems.last().$dom_nodeType; |
90 elems = document.queryAll('[name="test$num"]'); | 90 elems = document.queryAll('[name="test$num"]'); |
91 ret = elems.last().$dom_nodeType; | 91 ret = elems.last().$dom_nodeType; |
92 } | 92 } |
93 }) | 93 }) |
94 .test('getElementsByName (not in document)', () { | 94 .test('getElementsByName (not in document)', () { |
95 for (int i = 0; i < num * 20; i++) { | 95 for (int i = 0; i < num * 20; i++) { |
96 ret = document.queryAll('[name="test"]').length == 0; | 96 ret = document.queryAll('[name="test"]').length == 0; |
97 ret = document.queryAll('[name="test"]').length == 0; | 97 ret = document.queryAll('[name="test"]').length == 0; |
98 ret = document.queryAll('[name="test"]').length == 0; | 98 ret = document.queryAll('[name="test"]').length == 0; |
99 ret = document.queryAll('[name="test"]').length == 0; | 99 ret = document.queryAll('[name="test"]').length == 0; |
100 ret = document.queryAll('[name="test"]').length == 0; | 100 ret = document.queryAll('[name="test"]').length == 0; |
101 } | 101 } |
102 }) | 102 }) |
103 .end(); | 103 .end(); |
104 } | 104 } |
OLD | NEW |