Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(974)

Side by Side Diff: samples/third_party/dromaeo/Dromaeo.dart

Issue 12317107: ceil/floor/truncate/round return integers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload due to error3 Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « samples/swarm/swarm_ui_lib/view/PagedViews.dart ('k') | samples/third_party/dromaeo/common/Math2.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698