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

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

Issue 11265024: Make methods in Stopwatch getters and rename to be more consistent. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files with co19 issue number. Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/corelib/stopwatch_test.dart ('k') | utils/css/tool.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #import("dart:html", prefix:"html"); 5 #import("dart:html", prefix:"html");
6 #import('../../../lib/compiler/compiler.dart', prefix: "compiler_lib"); 6 #import('../../../lib/compiler/compiler.dart', prefix: "compiler_lib");
7 #import('../../../lib/uri/uri.dart', prefix:"uri_lib"); 7 #import('../../../lib/uri/uri.dart', prefix:"uri_lib");
8 8
9 /** 9 /**
10 * This is the entrypoint for a version of the leg compiler that 10 * This is the entrypoint for a version of the leg compiler that
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 */ 64 */
65 String idOfFilename(String filename) { 65 String idOfFilename(String filename) {
66 return filename.replaceAll("/", "_").replaceAll(".", "_"); 66 return filename.replaceAll("/", "_").replaceAll(".", "_");
67 } 67 }
68 68
69 void run() { 69 void run() {
70 String mainFile = getText(MAIN_ID); 70 String mainFile = getText(MAIN_ID);
71 setText("input", readAll(mainFile)); 71 setText("input", readAll(mainFile));
72 Stopwatch stopwatch = new Stopwatch()..start(); 72 Stopwatch stopwatch = new Stopwatch()..start();
73 runLeg(); 73 runLeg();
74 int elapsedMillis = stopwatch.elapsedInMs(); 74 int elapsedMillis = stopwatch.elapsedMilliseconds;
75 if (output === null) { 75 if (output === null) {
76 output = "throw 'dart2js compilation error';\n"; 76 output = "throw 'dart2js compilation error';\n";
77 } 77 }
78 78
79 setText("output", output); 79 setText("output", output);
80 setText("warnings", warnings.toString()); 80 setText("warnings", warnings.toString());
81 int lineCount = lineCount(output); 81 int lineCount = lineCount(output);
82 String timing = "generated $lineCount lines " 82 String timing = "generated $lineCount lines "
83 "(${output.length} characters) in " 83 "(${output.length} characters) in "
84 "${((elapsedMillis) / 1000).toStringAsPrecision(3)} seconds"; 84 "${((elapsedMillis) / 1000).toStringAsPrecision(3)} seconds";
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 } 127 }
128 return element.text.trim(); 128 return element.text.trim();
129 } 129 }
130 130
131 // TODO(mattsh): should exist in standard lib somewhere 131 // TODO(mattsh): should exist in standard lib somewhere
132 static String htmlEscape(String text) { 132 static String htmlEscape(String text) {
133 return text.replaceAll('&', '&').replaceAll( 133 return text.replaceAll('&', '&').replaceAll(
134 '>', '&gt;').replaceAll('<', '&lt;'); 134 '>', '&gt;').replaceAll('<', '&lt;');
135 } 135 }
136 } 136 }
OLDNEW
« no previous file with comments | « tests/corelib/stopwatch_test.dart ('k') | utils/css/tool.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698