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

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

Issue 24096027: Dart2js support for custom element lifecycle events (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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
Index: tools/testing/dart/test_suite.dart
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index 022574d63b393b3bd9ec37fe1c5e3c71ab06d9b5..4b4a76e72ea276c10b2dc3aded05b97a4ddbea43 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -1000,7 +1000,22 @@ class StandardTestSuite extends TestSuite {
dartWrapperFilename = '${htmlPath}_bootstrap.dart';
compiledDartWrapperFilename = '$dartWrapperFilename.js';
} else {
- htmlPath = customHtmlPath;
+ htmlPath = '$tempDir/test.html';
+ dartWrapperFilename = filePath.toNativePath();
+
+ var htmlContents = customHtml.readAsStringSync();
+ if (compiler == 'none') {
+ htmlContents = htmlContents.replaceAll('%TEST_SCRIPTS%',
+ '<script type="application/dart" '
+ 'src="${_createUrlPathFromFile(filePath)}"></script>\n'
+ '<script type="text/javascript" '
+ 'src="/packages/browser/dart.js"></script>');
+ } else {
+ htmlContents = htmlContents.replaceAll('%TEST_SCRIPTS%',
+ '<script src="$nameNoExt.js"></script>');
+ compiledDartWrapperFilename = '$tempDir/$nameNoExt.js';
+ }
+ new File(htmlPath).writeAsStringSync(htmlContents);
Jennifer Messerly 2013/09/20 17:58:35 ..writeAsStringSync(htmlContents)..closeSync();
blois 2013/09/20 21:39:38 Is that necessary? From the docs of writeAsStringS
Jennifer Messerly 2013/09/20 21:54:35 Good catch. I just saw it was different from the o
}
} else {
htmlPath = '$tempDir/test.html';

Powered by Google App Engine
This is Rietveld 408576698