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

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

Issue 199003005: Package-ify Dromaeo and browser controller functionality (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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:convert"; 5 import "dart:convert";
6 import 'dart:math' as Math; 6 import 'dart:math' as Math;
7 import 'dart:js' as js;
7 import 'Suites.dart'; 8 import 'Suites.dart';
8 9
9 main() { 10 main() {
10 new Dromaeo().run(); 11 new Dromaeo().run();
11 } 12 }
12 13
13 class SuiteController { 14 class SuiteController {
14 final SuiteDescription _suiteDescription; 15 final SuiteDescription _suiteDescription;
15 final IFrameElement _suiteIframe; 16 final IFrameElement _suiteIframe;
16 17
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 _updateTime(); 195 _updateTime();
195 return running; 196 return running;
196 197
197 case 'over': 198 case 'over':
198 currentSuite++; 199 currentSuite++;
199 if (currentSuite < _suitesTotal) { 200 if (currentSuite < _suitesTotal) {
200 _suiteControllers[currentSuite].start(); 201 _suiteControllers[currentSuite].start();
201 return running; 202 return running;
202 } 203 }
203 document.body.attributes['class'] = 'alldone'; 204 document.body.attributes['class'] = 'alldone';
205 try {
vsm 2014/03/13 22:02:21 The try-catch is a bit ugly here. Consider someth
Emily Fortuna 2014/03/13 22:43:07 Fixed!
206 js.context.callMethod('reportPerformanceTestDone');
207 } catch (e) {
208 // This is not running as a performance test. Continue as normal.
209 window.console.log('Failed to call reportPerformanceTestDone. $e');
210 }
204 return done; 211 return done;
205 212
206 default: 213 default:
207 throw 'Unknown command ${command} [${data}]'; 214 throw 'Unknown command ${command} [${data}]';
208 } 215 }
209 }; 216 };
210 217
211 done = (String command, var data) { 218 done = (String command, var data) {
212 }; 219 };
213 220
214 return loading; 221 return loading;
215 } 222 }
216 223
217 _css(Element element, String property, String value) { 224 _css(Element element, String property, String value) {
218 // TODO(antonm): remove the last argument when CallWithDefaultValue 225 // TODO(antonm): remove the last argument when CallWithDefaultValue
219 // is implemented. 226 // is implemented.
220 element.style.setProperty(property, value, ''); 227 element.style.setProperty(property, value, '');
221 } 228 }
222 229
223 Element _byId(String id) { 230 Element _byId(String id) {
224 return document.querySelector('#$id'); 231 return document.querySelector('#$id');
225 } 232 }
226 233
227 int get _suitesTotal { 234 int get _suitesTotal {
228 return _suiteControllers.length; 235 return _suiteControllers.length;
229 } 236 }
230 } 237 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698