Index: samples/third_party/dromaeo/Dromaeo.dart |
diff --git a/samples/third_party/dromaeo/Dromaeo.dart b/samples/third_party/dromaeo/Dromaeo.dart |
index e9bcf4f89a2116a74f1ed54ddeb3e27e1790c6aa..85bee8ef5da0e47708c9212b42ecb0179bcd4183 100644 |
--- a/samples/third_party/dromaeo/Dromaeo.dart |
+++ b/samples/third_party/dromaeo/Dromaeo.dart |
@@ -1,3 +1,5 @@ |
+library dromaeo_test; |
+ |
import 'dart:html'; |
import 'dart:json' as json; |
import 'dart:math' as Math; |
@@ -98,7 +100,15 @@ class Dromaeo { |
final response = json.parse(event.data); |
_handler = _handler(response['command'], response['data']); |
} catch (e, stacktrace) { |
- window.alert('Exception: ${e}: ${stacktrace}'); |
Emily Fortuna
2013/01/30 01:15:56
The fact that this was an alert window causes issu
|
+ if (!(e is FormatException && |
+ (event.data.toString().startsWith('unittest') || |
+ event.data.toString().startsWith('dart')))) { |
+ // Hack because unittest also uses post messages to communicate. |
+ // So the fact that the event.data is not proper json is not |
+ // always an error. |
+ print('Exception: ${e}: ${stacktrace}'); |
+ print(event.data); |
+ } |
} |
}, |
false |
@@ -108,10 +118,9 @@ class Dromaeo { |
run() { |
// TODO(vsm): Initial page should not run. For now, run all |
// tests by default. |
- final splitUrl = window.location.href.split('?'); |
- var tags; |
- if (splitUrl.length > 1) { |
- tags = splitUrl[1]; |
+ var tags = window.location.search; |
+ if (tags.length > 1) { |
+ tags = tags.substring(1); |
} else if (window.navigator.userAgent.contains('(Dart)')) { |
// TODO(vsm): Update when we change Dart VM detection. |
tags = 'js|dart&html'; |