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

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

Issue 12086028: Fix up dromaeo after lib v2 merge and add Dromaeo smoketest to prevent future (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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
« no previous file with comments | « no previous file | samples/third_party/dromaeo/README » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library dromaeo_test;
2
1 import 'dart:html'; 3 import 'dart:html';
2 import 'dart:json' as json; 4 import 'dart:json' as json;
3 import 'dart:math' as Math; 5 import 'dart:math' as Math;
4 import 'Suites.dart'; 6 import 'Suites.dart';
5 7
6 main() { 8 main() {
7 new Dromaeo().run(); 9 new Dromaeo().run();
8 } 10 }
9 11
10 class SuiteController { 12 class SuiteController {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 Dromaeo() 93 Dromaeo()
92 : _suiteControllers = new List<SuiteController>() 94 : _suiteControllers = new List<SuiteController>()
93 { 95 {
94 _handler = _createHandler(); 96 _handler = _createHandler();
95 window.onMessage.listen( 97 window.onMessage.listen(
96 (MessageEvent event) { 98 (MessageEvent event) {
97 try { 99 try {
98 final response = json.parse(event.data); 100 final response = json.parse(event.data);
99 _handler = _handler(response['command'], response['data']); 101 _handler = _handler(response['command'], response['data']);
100 } catch (e, stacktrace) { 102 } catch (e, stacktrace) {
101 window.alert('Exception: ${e}: ${stacktrace}'); 103 if (!(e is FormatException &&
104 (event.data.toString().startsWith('unittest') ||
105 event.data.toString().startsWith('dart')))) {
106 // Hack because unittest also uses post messages to communicate.
107 // So the fact that the event.data is not proper json is not
108 // always an error.
109 print('Exception: ${e}: ${stacktrace}');
110 print(event.data);
111 }
102 } 112 }
103 }); 113 });
104 } 114 }
105 115
106 run() { 116 run() {
107 // TODO(vsm): Initial page should not run. For now, run all 117 // TODO(vsm): Initial page should not run. For now, run all
108 // tests by default. 118 // tests by default.
109 final splitUrl = window.location.href.split('?'); 119 var tags = window.location.search;
110 var tags; 120 if (tags.length > 1) {
111 if (splitUrl.length > 1) { 121 tags = tags.substring(1);
112 tags = splitUrl[1];
113 } else if (window.navigator.userAgent.contains('(Dart)')) { 122 } else if (window.navigator.userAgent.contains('(Dart)')) {
114 // TODO(vsm): Update when we change Dart VM detection. 123 // TODO(vsm): Update when we change Dart VM detection.
115 tags = 'js|dart&html'; 124 tags = 'js|dart&html';
116 } else { 125 } else {
117 tags = 'js|dart2js&html'; 126 tags = 'js|dart2js&html';
118 } 127 }
119 128
120 // TODO(antonm): create Re-run tests href. 129 // TODO(antonm): create Re-run tests href.
121 final Element suiteNameElement = _byId('overview').nodes[0]; 130 final Element suiteNameElement = _byId('overview').nodes[0];
122 final category = Suites.getCategory(tags); 131 final category = Suites.getCategory(tags);
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 } 220 }
212 221
213 Element _byId(String id) { 222 Element _byId(String id) {
214 return document.query('#$id'); 223 return document.query('#$id');
215 } 224 }
216 225
217 int get _suitesTotal { 226 int get _suitesTotal {
218 return _suiteControllers.length; 227 return _suiteControllers.length;
219 } 228 }
220 } 229 }
OLDNEW
« no previous file with comments | « no previous file | samples/third_party/dromaeo/README » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698