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

Side by Side Diff: utils/testrunner/utils.dart

Issue 10909240: Support for pixel layout tests. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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
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 /** 5 /**
6 * Read the contents of a file [fileName] into a [List] of [String]s. 6 * Read the contents of a file [fileName] into a [List] of [String]s.
7 * If the file does not exist and [errorIfNoFile] is true, throw an 7 * If the file does not exist and [errorIfNoFile] is true, throw an
8 * exception, else return an empty list. 8 * exception, else return an empty list.
9 */ 9 */
10 List<String> getFileContents(String filename, bool errorIfNoFile) { 10 List<String> getFileContents(String filename, bool errorIfNoFile) {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 print('$path does not exist.'); 89 print('$path does not exist.');
90 } 90 }
91 } 91 }
92 } 92 }
93 if (--dirCount == 0) { 93 if (--dirCount == 0) {
94 onComplete(files); 94 onComplete(files);
95 } 95 }
96 } 96 }
97 97
98 /** Delete a file. */ 98 /** Delete a file. */
99 void deleteFile(String fname) { 99 bool deleteFile(String fname) {
100 var f = new File(fname); 100 var f = new File(fname);
101 f.deleteSync(); 101 try {
102 f.deleteSync();
103 } catch (e) {
104 return false;
105 }
106 return true;
102 } 107 }
103 108
104 /** Get the name of the layout render file for a test. */ 109 /**
105 String layoutFileName(String testname) => 110 * Get the directory that testrunner lives in; we need it to import
106 testname.replaceAll(new RegExp('\.dart\$'), '.render'); 111 * support files into the generated scripts.
112 */
107 113
108 /** Check if a test is a layout render test. renders. 114 String get runnerDirectory() {
109 */ 115 var libDirectory = makePathAbsolute(new Options().script);
110 bool isLayoutRenderTest(String testname) { 116 return libDirectory.substring(0,
111 var layoutname = layoutFileName(testname); 117 libDirectory.lastIndexOf(Platform.pathSeparator));
112 var f = new File(layoutname);
113 return f.existsSync();
114 } 118 }
119
OLDNEW
« utils/testrunner/layout_test_controller.dart ('K') | « utils/testrunner/testrunner.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698