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 #source("Common.dart"); | 4 #source("Common.dart"); |
5 #source("RunnerSuite.dart"); | 5 #source("RunnerSuite.dart"); |
6 | 6 |
7 void main() { | 7 void main() { |
8 final int num = 40; | 8 final int num = 40; |
9 | 9 |
10 // Try to force real results. | 10 // Try to force real results. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 ret = document.query('#testA'); | 43 ret = document.query('#testA'); |
44 ret = document.query('#testB'); | 44 ret = document.query('#testB'); |
45 ret = document.query('#testC'); | 45 ret = document.query('#testC'); |
46 ret = document.query('#testD'); | 46 ret = document.query('#testD'); |
47 ret = document.query('#testE'); | 47 ret = document.query('#testE'); |
48 ret = document.query('#testF'); | 48 ret = document.query('#testF'); |
49 } | 49 } |
50 }) | 50 }) |
51 .test('getElementsByTagName(div)', () { | 51 .test('getElementsByTagName(div)', () { |
52 for (int i = 0; i < num; i++) { | 52 for (int i = 0; i < num; i++) { |
53 ElementList elems = document.queryAll('div'); | 53 List<Element> elems = document.queryAll('div'); |
54 ret = elems.last().$dom_nodeType; | 54 ret = elems.last().$dom_nodeType; |
55 } | 55 } |
56 }) | 56 }) |
57 .test('getElementsByTagName(p)', () { | 57 .test('getElementsByTagName(p)', () { |
58 for (int i = 0; i < num; i++) { | 58 for (int i = 0; i < num; i++) { |
59 ElementList elems = document.queryAll('p'); | 59 List<Element> elems = document.queryAll('p'); |
60 ret = elems.last().$dom_nodeType; | 60 ret = elems.last().$dom_nodeType; |
61 } | 61 } |
62 }) | 62 }) |
63 .test('getElementsByTagName(a)', () { | 63 .test('getElementsByTagName(a)', () { |
64 for (int i = 0; i < num; i++) { | 64 for (int i = 0; i < num; i++) { |
65 ElementList elems = document.queryAll('a'); | 65 List<Element> elems = document.queryAll('a'); |
66 ret = elems.last().$dom_nodeType; | 66 ret = elems.last().$dom_nodeType; |
67 } | 67 } |
68 }) | 68 }) |
69 .test('getElementsByTagName(*)', () { | 69 .test('getElementsByTagName(*)', () { |
70 for (int i = 0; i < num; i++) { | 70 for (int i = 0; i < num; i++) { |
71 ElementList elems = document.queryAll('*'); | 71 List<Element> elems = document.queryAll('*'); |
72 ret = elems.last().$dom_nodeType; | 72 ret = elems.last().$dom_nodeType; |
73 } | 73 } |
74 }) | 74 }) |
75 .test('getElementsByTagName (not in document)', () { | 75 .test('getElementsByTagName (not in document)', () { |
76 for (int i = 0; i < num; i++) { | 76 for (int i = 0; i < num; i++) { |
77 ElementList elems = document.queryAll('strong'); | 77 List<Element> elems = document.queryAll('strong'); |
78 ret = elems.isEmpty(); | 78 ret = elems.isEmpty(); |
79 } | 79 } |
80 }) | 80 }) |
81 .test('getElementsByName', () { | 81 .test('getElementsByName', () { |
82 for (int i = 0; i < num * 20; i++) { | 82 for (int i = 0; i < num * 20; i++) { |
83 ElementList elems = document.queryAll('[name="test$num"]'); | 83 List<Element> elems = document.queryAll('[name="test$num"]'); |
84 ret = elems.last().$dom_nodeType; | 84 ret = elems.last().$dom_nodeType; |
85 elems = document.queryAll('[name="test$num"]'); | 85 elems = document.queryAll('[name="test$num"]'); |
86 ret = elems.last().$dom_nodeType; | 86 ret = elems.last().$dom_nodeType; |
87 elems = document.queryAll('[name="test$num"]'); | 87 elems = document.queryAll('[name="test$num"]'); |
88 ret = elems.last().$dom_nodeType; | 88 ret = elems.last().$dom_nodeType; |
89 elems = document.queryAll('[name="test$num"]'); | 89 elems = document.queryAll('[name="test$num"]'); |
90 ret = elems.last().$dom_nodeType; | 90 ret = elems.last().$dom_nodeType; |
91 } | 91 } |
92 }) | 92 }) |
93 .test('getElementsByName (not in document)', () { | 93 .test('getElementsByName (not in document)', () { |
94 for (int i = 0; i < num * 20; i++) { | 94 for (int i = 0; i < num * 20; i++) { |
95 ret = document.queryAll('[name="test"]').length == 0; | 95 ret = document.queryAll('[name="test"]').length == 0; |
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 } | 100 } |
101 }) | 101 }) |
102 .end(); | 102 .end(); |
103 } | 103 } |
OLD | NEW |