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

Unified Diff: tools/testing/dart/html_test.dart

Issue 2903703002: Tighten types in test.dart even more. (Closed)
Patch Set: Play nicer with strong mode. Created 3 years, 7 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 | « tools/testing/dart/drt_updater.dart ('k') | tools/testing/dart/http_server.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/html_test.dart
diff --git a/tools/testing/dart/html_test.dart b/tools/testing/dart/html_test.dart
index dfa555ffb03449c70e808337c26a7a7ba58a1c1f..864a6d2cef30bb85275f3f615f32fcf536bbda14 100644
--- a/tools/testing/dart/html_test.dart
+++ b/tools/testing/dart/html_test.dart
@@ -27,9 +27,11 @@ HtmlTestInformation getInformation(String filename) {
" Should end in _htmltest.html.");
return null;
}
- String contents = new File(filename).readAsStringSync();
+
+ var contents = new File(filename).readAsStringSync();
var match = htmlAnnotation.firstMatch(contents);
if (match == null) return null;
+
var annotation = JSON.decode(match[1]);
if (annotation is! Map ||
annotation['expectedMessages'] is! List ||
@@ -38,8 +40,11 @@ HtmlTestInformation getInformation(String filename) {
" Should have {'scripts':[...], 'expectedMessages':[...]}");
return null;
}
- return new HtmlTestInformation(new Path(filename),
- annotation['expectedMessages'], annotation['scripts']);
+
+ return new HtmlTestInformation(
+ new Path(filename),
+ new List<String>.from(annotation['expectedMessages'] as List),
+ new List<String>.from(annotation['scripts'] as List));
}
String getContents(HtmlTestInformation info, bool compileToJS) {
« no previous file with comments | « tools/testing/dart/drt_updater.dart ('k') | tools/testing/dart/http_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698