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

Side by Side Diff: tools/testing/dart/browser_test.dart

Issue 10683009: Adds support for layout tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge changes Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/utils/utils.status ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 String GetHtmlContents(String title, 5 String getHtmlContents(String title,
6 String controllerScript, 6 String controllerScript,
7 String scriptType, 7 String scriptType,
8 String sourceScript) => 8 String sourceScript) =>
9 """ 9 """
10 <!DOCTYPE html> 10 <!DOCTYPE html>
11 <html> 11 <html>
12 <head> 12 <head>
13 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 13 <meta http-equiv="X-UA-Compatible" content="IE=edge">
14 <title> Test $title </title> 14 <title> Test $title </title>
15 <style> 15 <style>
16 .unittest-table { font-family:monospace; border:1px; } 16 .unittest-table { font-family:monospace; border:1px; }
17 .unittest-pass { background: #6b3;} 17 .unittest-pass { background: #6b3;}
18 .unittest-fail { background: #d55;} 18 .unittest-fail { background: #d55;}
19 .unittest-error { background: #a11;} 19 .unittest-error { background: #a11;}
20 </style> 20 </style>
21 </head> 21 </head>
22 <body> 22 <body>
23 <h1> Running $title </h1> 23 <h1> Running $title </h1>
24 <script type="text/javascript" src="$controllerScript"></script> 24 <script type="text/javascript" src="$controllerScript"></script>
25 <script type="$scriptType" src="$sourceScript"></script> 25 <script type="$scriptType" src="$sourceScript"></script>
26 </body> 26 </body>
27 </html> 27 </html>
28 """; 28 """;
29 29
30 String WrapDartTestInLibrary(Path test) => 30 String getHtmlLayoutContents(String scriptType, String sourceScript) =>
31 """
32 <!DOCTYPE html>
33 <html>
34 <head>
35 <meta http-equiv="X-UA-Compatible" content="IE=edge">
36 </head>
37 <body>
38 <script type="text/javascript">
39 if (navigator.webkitStartDart) navigator.webkitStartDart();
40 </script>
41 <script type="$scriptType" src="$sourceScript"></script>
42 </body>
43 </html>
44 """;
45
46 String wrapDartTestInLibrary(Path test) =>
31 """ 47 """
32 #library('libraryWrapper'); 48 #library('libraryWrapper');
33 #source('$test'); 49 #source('$test');
34 """; 50 """;
35 51
36 String DartTestWrapper(Path dartHome, Path library) => 52 String dartTestWrapper(Path dartHome, Path library) =>
37 """ 53 """
38 #library('test'); 54 #library('test');
39 55
40 #import('${dartHome.append('lib/unittest/unittest.dart')}', prefix: 'unittest'); 56 #import('${dartHome.append('lib/unittest/unittest.dart')}', prefix: 'unittest');
41 #import('${dartHome.append('lib/unittest/html_config.dart')}', 57 #import('${dartHome.append('lib/unittest/html_config.dart')}',
42 prefix: 'config'); 58 prefix: 'config');
43 59
44 #import('${library}', prefix: "Test"); 60 #import('${library}', prefix: "Test");
45 61
46 main() { 62 main() {
47 config.useHtmlConfiguration(); 63 config.useHtmlConfiguration();
48 try { 64 try {
49 unittest.ensureInitialized(); 65 unittest.ensureInitialized();
50 Test.main(); 66 Test.main();
51 } catch(var e, var trace) { 67 } catch(var e, var trace) {
52 unittest.reportTestError( 68 unittest.reportTestError(
53 e.toString(), trace == null ? '' : trace.toString()); 69 e.toString(), trace == null ? '' : trace.toString());
54 } 70 }
55 } 71 }
56 """; 72 """;
57 73
OLDNEW
« no previous file with comments | « tests/utils/utils.status ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698