| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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; |
| 152 int totalTests = 0; | 152 int totalTests = 0; |
| 153 int currentSuite; | 153 int currentSuite; |
| 154 double totalTimeSecs, estimatedTimeSecs; | 154 double totalTimeSecs, estimatedTimeSecs; |
| 155 | 155 |
| 156 // TODO(jat): Remove void type below. Bug 5269037. | 156 // TODO(jat): Remove void type below. Bug 5269037. |
| 157 void _updateTime() { | 157 void _updateTime() { |
| 158 final mins = (estimatedTimeSecs / 60).floor().toInt(); | 158 final mins = (estimatedTimeSecs / 60).floor(); |
| 159 final secs = (estimatedTimeSecs - mins * 60).round().toInt(); | 159 final secs = (estimatedTimeSecs - mins * 60).round(); |
| 160 final secsAsString = '${(secs < 10 ? "0" : "")}$secs'; | 160 final secsAsString = '${(secs < 10 ? "0" : "")}$secs'; |
| 161 _byId('left').innerHtml = '${mins}:${secsAsString}'; | 161 _byId('left').innerHtml = '${mins}:${secsAsString}'; |
| 162 | 162 |
| 163 final elapsed = totalTimeSecs - estimatedTimeSecs; | 163 final elapsed = totalTimeSecs - estimatedTimeSecs; |
| 164 final percent = (100 * elapsed / totalTimeSecs).toStringAsFixed(2); | 164 final percent = (100 * elapsed / totalTimeSecs).toStringAsFixed(2); |
| 165 _css(_byId('timebar'), 'width', '${percent}%'); | 165 _css(_byId('timebar'), 'width', '${percent}%'); |
| 166 } | 166 } |
| 167 | 167 |
| 168 Function loading, running, done; | 168 Function loading, running, done; |
| 169 | 169 |
| (...skipping 51 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 |