| 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 _stackMeta(bool fancyStacks, bool filterStacks) { |
| 8 if (fancyStacks) { |
| 9 if (!filterStacks) { |
| 10 return '<meta name="dart.unittest" content="full-stack-traces">\n'; |
| 11 } |
| 12 } else { |
| 13 return '<meta name="dart.unittest" content="raw-stack-traces">\n'; |
| 14 } |
| 15 return ''; |
| 16 } |
| 17 |
| 7 String getHtmlContents(String title, | 18 String getHtmlContents(String title, |
| 8 String scriptType, | 19 String scriptType, |
| 9 Path sourceScript) => | 20 Path sourceScript, |
| 21 bool fancyStacks, |
| 22 bool filterStacks) => |
| 10 """ | 23 """ |
| 11 <!DOCTYPE html> | 24 <!DOCTYPE html> |
| 12 <html> | 25 <html> |
| 13 <head> | 26 <head> |
| 14 <meta http-equiv="X-UA-Compatible" content="IE=edge"> | 27 <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 15 <title> Test $title </title> | 28 ${_stackMeta(fancyStacks, filterStacks)}<title> Test $title </title> |
| 16 <style> | 29 <style> |
| 17 .unittest-table { font-family:monospace; border:1px; } | 30 .unittest-table { font-family:monospace; border:1px; } |
| 18 .unittest-pass { background: #6b3;} | 31 .unittest-pass { background: #6b3;} |
| 19 .unittest-fail { background: #d55;} | 32 .unittest-fail { background: #d55;} |
| 20 .unittest-error { background: #a11;} | 33 .unittest-error { background: #a11;} |
| 21 </style> | 34 </style> |
| 22 </head> | 35 </head> |
| 23 <body> | 36 <body> |
| 24 <h1> Running $title </h1> | 37 <h1> Running $title </h1> |
| 25 <script type="text/javascript" | 38 <script type="text/javascript" |
| 26 src="/root_dart/pkg/unittest/lib/test_controller.js"> | 39 src="/root_dart/pkg/unittest/lib/test_controller.js"> |
| 27 </script> | 40 </script> |
| 28 <script type="$scriptType" src="$sourceScript" onerror="externalError(null)" | 41 <script type="$scriptType" src="$sourceScript" onerror="externalError(null)" |
| 29 defer> | 42 defer> |
| 30 </script> | 43 </script> |
| 31 <script type="text/javascript" | 44 <script type="text/javascript" |
| 32 src="/root_dart/pkg/browser/lib/dart.js"></script> | 45 src="/root_dart/pkg/browser/lib/dart.js"></script> |
| 33 <script type="text/javascript" | 46 <script type="text/javascript" |
| 34 src="/root_dart/pkg/browser/lib/interop.js"></script> | 47 src="/root_dart/pkg/browser/lib/interop.js"></script> |
| 35 </body> | 48 </body> |
| 36 </html> | 49 </html> |
| 37 """; | 50 """; |
| 38 | 51 |
| 39 String getHtmlLayoutContents(String scriptType, Path sourceScript) => | 52 String getHtmlLayoutContents(String scriptType, |
| 53 Path sourceScript, |
| 54 bool fancyStacks, |
| 55 bool filterStacks) => |
| 40 """ | 56 """ |
| 41 <!DOCTYPE html> | 57 <!DOCTYPE html> |
| 42 <html> | 58 <html> |
| 43 <head> | 59 <head> |
| 44 <meta http-equiv="X-UA-Compatible" content="IE=edge"> | 60 <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 45 </head> | 61 ${_stackMeta(fancyStacks, filterStacks)}</head> |
| 46 <body> | 62 <body> |
| 47 <script type="text/javascript"> | 63 <script type="text/javascript"> |
| 48 if (navigator.webkitStartDart) navigator.webkitStartDart(); | 64 if (navigator.webkitStartDart) navigator.webkitStartDart(); |
| 49 </script> | 65 </script> |
| 50 <script type="$scriptType" src="$sourceScript" defer></script> | 66 <script type="$scriptType" src="$sourceScript" defer></script> |
| 51 </body> | 67 </body> |
| 52 </html> | 68 </html> |
| 53 """; | 69 """; |
| 54 | 70 |
| 55 String dartTestWrapper(bool usePackageImport, String libraryPathComponent) { | 71 String dartTestWrapper(bool usePackageImport, String libraryPathComponent) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 67 import '$unitTest/unittest.dart' as unittest; | 83 import '$unitTest/unittest.dart' as unittest; |
| 68 import '$unitTest/html_config.dart' as config; | 84 import '$unitTest/html_config.dart' as config; |
| 69 import '$libraryPathComponent' as Test; | 85 import '$libraryPathComponent' as Test; |
| 70 | 86 |
| 71 main() { | 87 main() { |
| 72 config.useHtmlConfiguration(); | 88 config.useHtmlConfiguration(); |
| 73 unittest.group('', Test.main); | 89 unittest.group('', Test.main); |
| 74 } | 90 } |
| 75 """; | 91 """; |
| 76 } | 92 } |
| OLD | NEW |