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

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/Suites.dart » ('j') | tests/html/dromaeo_noop/dromaeo_smoke.dart » ('J')
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 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';
« no previous file with comments | « no previous file | samples/third_party/dromaeo/Suites.dart » ('j') | tests/html/dromaeo_noop/dromaeo_smoke.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698