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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 ret = document.query('#testB'); | 45 ret = document.query('#testB'); |
46 ret = document.query('#testC'); | 46 ret = document.query('#testC'); |
47 ret = document.query('#testD'); | 47 ret = document.query('#testD'); |
48 ret = document.query('#testE'); | 48 ret = document.query('#testE'); |
49 ret = document.query('#testF'); | 49 ret = document.query('#testF'); |
50 } | 50 } |
51 }) | 51 }) |
52 .test('getElementsByTagName(div)', () { | 52 .test('getElementsByTagName(div)', () { |
53 for (int i = 0; i < num; i++) { | 53 for (int i = 0; i < num; i++) { |
54 List<Element> elems = document.queryAll('div'); | 54 List<Element> elems = document.queryAll('div'); |
55 ret = elems.last().$dom_nodeType; | 55 ret = elems.last.$dom_nodeType; |
56 } | 56 } |
57 }) | 57 }) |
58 .test('getElementsByTagName(p)', () { | 58 .test('getElementsByTagName(p)', () { |
59 for (int i = 0; i < num; i++) { | 59 for (int i = 0; i < num; i++) { |
60 List<Element> elems = document.queryAll('p'); | 60 List<Element> elems = document.queryAll('p'); |
61 ret = elems.last().$dom_nodeType; | 61 ret = elems.last.$dom_nodeType; |
62 } | 62 } |
63 }) | 63 }) |
64 .test('getElementsByTagName(a)', () { | 64 .test('getElementsByTagName(a)', () { |
65 for (int i = 0; i < num; i++) { | 65 for (int i = 0; i < num; i++) { |
66 List<Element> elems = document.queryAll('a'); | 66 List<Element> elems = document.queryAll('a'); |
67 ret = elems.last().$dom_nodeType; | 67 ret = elems.last.$dom_nodeType; |
68 } | 68 } |
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 |