OLD | NEW |
1 library dromaeo_test; | 1 library dromaeo_test; |
2 | 2 |
3 import 'dart:html'; | 3 import 'dart:html'; |
4 import 'dart:async'; | 4 import 'dart:async'; |
5 import 'dart:json' as json; | 5 import 'dart:json' as json; |
6 import 'dart:math' as Math; | 6 import 'dart:math' as Math; |
7 import 'Suites.dart'; | 7 import 'Suites.dart'; |
8 | 8 |
9 main() { | 9 main() { |
10 new Dromaeo().run(); | 10 new Dromaeo().run(); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 _element.innerHtml = | 61 _element.innerHtml = |
62 '<b>${suiteName}:</b>' | 62 '<b>${suiteName}:</b>' |
63 '<div class="bar"><div style="width:${percent}%;">${info}</div></div>'; | 63 '<div class="bar"><div style="width:${percent}%;">${info}</div></div>'; |
64 } | 64 } |
65 | 65 |
66 _init() { | 66 _init() { |
67 final div = _createDiv('result-item'); | 67 final div = _createDiv('result-item'); |
68 div.nodes.add(_element); | 68 div.nodes.add(_element); |
69 final description = _suiteDescription.description; | 69 final description = _suiteDescription.description; |
70 final originUrl = _suiteDescription.origin.url; | 70 final originUrl = _suiteDescription.origin.url; |
71 final testUrl = 'tests/${_suiteDescription.file}'; | 71 final testUrl = '${_suiteDescription.file}'; |
72 div.innerHtml = | 72 div.innerHtml = |
73 '${div.innerHtml}<p>${description}<br/><a href="${originUrl}">Origin</a' | 73 '${div.innerHtml}<p>${description}<br/><a href="${originUrl}">Origin</a' |
74 '>, <a href="${testUrl}">Source</a>' | 74 '>, <a href="${testUrl}">Source</a>' |
75 '<ol class="results"></ol>'; | 75 '<ol class="results"></ol>'; |
76 // Reread the element, as the previous wrapper get disconnected thanks | 76 // Reread the element, as the previous wrapper get disconnected thanks |
77 // to .innerHtml update above. | 77 // to .innerHtml update above. |
78 _element = div.nodes[0]; | 78 _element = div.nodes[0]; |
79 | 79 |
80 document.query('#main').nodes.add(div); | 80 document.query('#main').nodes.add(div); |
81 } | 81 } |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 final Element suiteNameElement = _byId('overview').nodes[0]; | 131 final Element suiteNameElement = _byId('overview').nodes[0]; |
132 final category = Suites.getCategory(tags); | 132 final category = Suites.getCategory(tags); |
133 if (category != null) { | 133 if (category != null) { |
134 suiteNameElement.innerHtml = category; | 134 suiteNameElement.innerHtml = category; |
135 } | 135 } |
136 _css(_byId('tests'), 'display', 'none'); | 136 _css(_byId('tests'), 'display', 'none'); |
137 for (SuiteDescription suite in Suites.getSuites(tags)) { | 137 for (SuiteDescription suite in Suites.getSuites(tags)) { |
138 final iframe = new IFrameElement(); | 138 final iframe = new IFrameElement(); |
139 _css(iframe, 'height', '1px'); | 139 _css(iframe, 'height', '1px'); |
140 _css(iframe, 'width', '1px'); | 140 _css(iframe, 'width', '1px'); |
141 iframe.src = 'tests/${suite.file}'; | 141 iframe.src = '${suite.file}'; |
142 document.body.nodes.add(iframe); | 142 document.body.nodes.add(iframe); |
143 | 143 |
144 _suiteControllers.add(new SuiteController(suite, iframe)); | 144 _suiteControllers.add(new SuiteController(suite, iframe)); |
145 } | 145 } |
146 } | 146 } |
147 | 147 |
148 static const double _SECS_PER_TEST = 5.0; | 148 static const double _SECS_PER_TEST = 5.0; |
149 | 149 |
150 Function _createHandler() { | 150 Function _createHandler() { |
151 int suitesLoaded = 0; | 151 int suitesLoaded = 0; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 } | 221 } |
222 | 222 |
223 Element _byId(String id) { | 223 Element _byId(String id) { |
224 return document.query('#$id'); | 224 return document.query('#$id'); |
225 } | 225 } |
226 | 226 |
227 int get _suitesTotal { | 227 int get _suitesTotal { |
228 return _suiteControllers.length; | 228 return _suiteControllers.length; |
229 } | 229 } |
230 } | 230 } |
OLD | NEW |