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

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

Issue 8995009: Implement chromium component. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 9 years 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 | « no previous file | tools/testing/dart/test_options.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 <html> 10 <html>
11 <head> 11 <head>
12 <title> Test $title </title> 12 <title> Test $title </title>
13 <style> 13 <style>
14 .unittest-table { font-family:monospace; border:1px; } 14 .unittest-table { font-family:monospace; border:1px; }
15 .unittest-pass { background: #6b3;} 15 .unittest-pass { background: #6b3;}
16 .unittest-fail { background: #d55;} 16 .unittest-fail { background: #d55;}
17 .unittest-error { background: #a11;} 17 .unittest-error { background: #a11;}
18 </style> 18 </style>
19 </head> 19 </head>
20 <body> 20 <body>
21 <h1> Running $title </h1> 21 <h1> Running $title </h1>
22 <script type="text/javascript" src="../../../$controllerScript"></script> 22 <script type="text/javascript" src="$controllerScript"></script>
23 <script type="$scriptType" src="../../../$sourceScript"></script> 23 <script type="$scriptType" src="$sourceScript"></script>
24 <script type="text/javascript"> 24 <script type="text/javascript">
25 // If nobody intercepts the error, finish the test. 25 // If nobody intercepts the error, finish the test.
26 onerror = function() { window.layoutTestController.notifyDone() }; 26 onerror = function() { window.layoutTestController.notifyDone() };
27 27
28 document.onreadystatechange = function() { 28 document.onreadystatechange = function() {
29 if (document.readyState != "loaded") return; 29 if (document.readyState != "loaded") return;
30 // If 'startedDartTest' is not set, that means that the test did not have 30 // If 'startedDartTest' is not set, that means that the test did not have
31 // a chance to load. This will happen when a load error occurs in the VM. 31 // a chance to load. This will happen when a load error occurs in the VM.
32 // Give the machine time to start up. 32 // Give the machine time to start up.
33 setTimeout(function() { 33 setTimeout(function() {
(...skipping 11 matching lines...) Expand all
45 </body> 45 </body>
46 </html> 46 </html>
47 """; 47 """;
48 48
49 String WrapDartTestInLibrary(String test) => 49 String WrapDartTestInLibrary(String test) =>
50 """ 50 """
51 #library('libraryWrapper'); 51 #library('libraryWrapper');
52 #source('$test'); 52 #source('$test');
53 """; 53 """;
54 54
55 String DartTestWrapper(String unittest_ignored, 55 String DartTestWrapper(String domLibrary,
56 String test_ignored,
57 String domLibrary,
58 String testFramework, 56 String testFramework,
59 String library) => 57 String library) =>
60 """ 58 """
61 #library('test'); 59 #library('test');
62 60
63 #import('${domLibrary}'); 61 #import('${domLibrary}');
64 #import('${testFramework}'); 62 #import('${testFramework}');
65 63
66 #import('${library}', prefix: "Test"); 64 #import('${library}', prefix: "Test");
67 65
(...skipping 28 matching lines...) Expand all
96 waitForDone(); 94 waitForDone();
97 } else { 95 } else {
98 pass(); 96 pass();
99 } 97 }
100 mainIsFinished = true; 98 mainIsFinished = true;
101 } catch(var e, var trace) { 99 } catch(var e, var trace) {
102 fail(e, trace); 100 fail(e, trace);
103 } 101 }
104 } 102 }
105 """; 103 """;
OLDNEW
« no previous file with comments | « no previous file | tools/testing/dart/test_options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698