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

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

Issue 36913002: test.py: Sending JSON between test_controller.js <-> browser_controller (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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: dart/tools/testing/dart/browser_test.dart
diff --git a/dart/tools/testing/dart/browser_test.dart b/dart/tools/testing/dart/browser_test.dart
index 5d49a0a2ccf8f449c7765bc7c4b8670a010b5234..310e5a7deb668b038e3cb6fcc65a2b131bf02248 100644
--- a/dart/tools/testing/dart/browser_test.dart
+++ b/dart/tools/testing/dart/browser_test.dart
@@ -6,8 +6,13 @@ part of test_suite;
String getHtmlContents(String title,
String scriptType,
- Path sourceScript) =>
-"""
+ Path sourceScript,
+ {bool use_unittest_controller: false}) {
+ var testControllerJs = '/root_dart/tools/testing/dart/test_controller.js';
+ if (use_unittest_controller) {
+ testControllerJs = '/root_dart/pkg/unittest/lib/test_controller.js';
+ }
+ return """
<!DOCTYPE html>
<html>
<head>
@@ -24,9 +29,9 @@ String getHtmlContents(String title,
<body>
<h1> Running $title </h1>
<script type="text/javascript"
- src="/root_dart/pkg/unittest/lib/test_controller.js">
+ src="$testControllerJs">
</script>
- <script type="$scriptType" src="$sourceScript" onerror="externalError(null)"
+ <script type="$scriptType" src="$sourceScript" onerror="scriptTagOnErrorCallback(null)"
defer>
</script>
<script type="text/javascript"
@@ -34,8 +39,8 @@ String getHtmlContents(String title,
<script type="text/javascript"
src="/root_dart/pkg/browser/lib/interop.js"></script>
</body>
-</html>
-""";
+</html>""";
+}
String dartTestWrapper(String libraryPathComponent) {
return """
@@ -47,4 +52,4 @@ main() {
print("dart-main-done");
}
""";
-}
+}
Bill Hesse 2013/11/15 11:24:03 I hope this is adding a \n, not removing one.
kustermann 2013/11/19 10:06:10 I hope so as well :)

Powered by Google App Engine
This is Rietveld 408576698