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

Unified 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, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | samples/third_party/dromaeo/README » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/third_party/dromaeo/Dromaeo.dart
diff --git a/samples/third_party/dromaeo/Dromaeo.dart b/samples/third_party/dromaeo/Dromaeo.dart
index b5eaaa700982fc409bc6eb69c973a6596424b921..f64dfdba617a0e6027c809dc48cf3a57029d8a8d 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}');
+ 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);
+ }
}
});
}
@@ -106,10 +116,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';
« 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