| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of test_suite; | 5 part of test_suite; |
| 6 | 6 |
| 7 String getHtmlContents(String title, | 7 String getHtmlContents(String title, |
| 8 String scriptType, | 8 String scriptType, |
| 9 Path sourceScript, | 9 Path sourceScript) { |
| 10 {bool use_unittest_controller: false}) { | |
| 11 var testControllerJs = '/root_dart/tools/testing/dart/test_controller.js'; | |
| 12 if (use_unittest_controller) { | |
| 13 testControllerJs = '/root_dart/pkg/unittest/lib/test_controller.js'; | |
| 14 } | |
| 15 return """ | 10 return """ |
| 16 <!DOCTYPE html> | 11 <!DOCTYPE html> |
| 17 <html> | 12 <html> |
| 18 <head> | 13 <head> |
| 19 <meta http-equiv="X-UA-Compatible" content="IE=edge"> | 14 <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 20 <meta name="dart.unittest" content="full-stack-traces"> | 15 <meta name="dart.unittest" content="full-stack-traces"> |
| 21 <title> Test $title </title> | 16 <title> Test $title </title> |
| 22 <style> | 17 <style> |
| 23 .unittest-table { font-family:monospace; border:1px; } | 18 .unittest-table { font-family:monospace; border:1px; } |
| 24 .unittest-pass { background: #6b3;} | 19 .unittest-pass { background: #6b3;} |
| 25 .unittest-fail { background: #d55;} | 20 .unittest-fail { background: #d55;} |
| 26 .unittest-error { background: #a11;} | 21 .unittest-error { background: #a11;} |
| 27 </style> | 22 </style> |
| 28 </head> | 23 </head> |
| 29 <body> | 24 <body> |
| 30 <h1> Running $title </h1> | 25 <h1> Running $title </h1> |
| 31 <script type="text/javascript" | 26 <script type="text/javascript" |
| 32 src="$testControllerJs"> | 27 src="/root_dart/tools/testing/dart/test_controller.js"> |
| 33 </script> | 28 </script> |
| 34 <script type="$scriptType" src="$sourceScript" | 29 <script type="$scriptType" src="$sourceScript" |
| 35 onerror="scriptTagOnErrorCallback(null)" | 30 onerror="scriptTagOnErrorCallback(null)" |
| 36 defer> | 31 defer> |
| 37 </script> | 32 </script> |
| 38 <script type="text/javascript" | 33 <script type="text/javascript" |
| 39 src="/root_dart/pkg/browser/lib/dart.js"></script> | 34 src="/root_dart/pkg/browser/lib/dart.js"></script> |
| 40 <script type="text/javascript" | 35 <script type="text/javascript" |
| 41 src="/root_dart/pkg/browser/lib/interop.js"></script> | 36 src="/root_dart/pkg/browser/lib/interop.js"></script> |
| 42 </body> | 37 </body> |
| 43 </html>"""; | 38 </html>"""; |
| 44 } | 39 } |
| 45 | 40 |
| 46 String dartTestWrapper(String libraryPathComponent) { | 41 String dartTestWrapper(String libraryPathComponent) { |
| 47 return """ | 42 return """ |
| 48 import '$libraryPathComponent' as test; | 43 import '$libraryPathComponent' as test; |
| 49 | 44 |
| 50 main() { | 45 main() { |
| 51 print("dart-calling-main"); | 46 print("dart-calling-main"); |
| 52 test.main(); | 47 test.main(); |
| 53 print("dart-main-done"); | 48 print("dart-main-done"); |
| 54 } | 49 } |
| 55 """; | 50 """; |
| 56 } | 51 } |
| OLD | NEW |