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

Unified Diff: tools/testing/dart/multitest.dart

Issue 8883017: Split File into File and RandomAccessFile. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/standalone/src/FileTest.dart ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/multitest.dart
diff --git a/tools/testing/dart/multitest.dart b/tools/testing/dart/multitest.dart
index 9a3045b5645fb71ab7802c16aaf307dad76f1717..8ab90388f36f8137fbc949aaf0ff20aec07003d6 100644
--- a/tools/testing/dart/multitest.dart
+++ b/tools/testing/dart/multitest.dart
@@ -48,8 +48,7 @@ void ExtractTestsFromMultitest(String filename,
// Read the entire file into a byte buffer and transform it to a
// String. This will treat the file as ascii but the only parts
// we are interested in will be ascii in any case.
- File file = new File(filename);
- file.openSync();
+ RandomAccessFile file = (new File(filename)).openSync();
List chars = new List(file.lengthSync());
int offset = 0;
while (offset != chars.length) {
@@ -166,32 +165,32 @@ WriteMultitestToFileAndQueueIt(Map<String, String> tests,
file.createHandler = () {
file.open(writable: true);
};
- file.openHandler = () {
+ file.openHandler = (RandomAccessFile openedFile) {
+ openedFile.noPendingWriteHandler =() {
+ openedFile.close();
+ };
+ openedFile.closeHandler = () {
+ var outcome = outcomes[key];
+ bool enableFatalTypeErrors = (supportsFatalTypeErrors &&
+ outcome.contains('static type error'));
+ bool isNegative = (outcome.contains('compile-time error') ||
+ outcome.contains('runtime error') ||
+ enableFatalTypeErrors);
+ bool isNegativeIfChecked = outcome.contains('dynamic type error');
+ doTest(filename,
+ isNegative,
+ isNegativeIfChecked,
+ enableFatalTypeErrors);
+ WriteMultitestToFileAndQueueIt(tests,
+ outcomes,
+ supportsFatalTypeErrors,
+ currentKey,
+ basePath,
+ doTest,
+ done);
+ };
var bytes = tests[key].charCodes();
- file.writeList(bytes, 0, bytes.length);
- };
- file.noPendingWriteHandler =() {
- file.close();
- };
- file.closeHandler = () {
- var outcome = outcomes[key];
- bool enableFatalTypeErrors = (supportsFatalTypeErrors &&
- outcome.contains('static type error'));
- bool isNegative = (outcome.contains('compile-time error') ||
- outcome.contains('runtime error') ||
- enableFatalTypeErrors);
- bool isNegativeIfChecked = outcome.contains('dynamic type error');
- doTest(filename,
- isNegative,
- isNegativeIfChecked,
- enableFatalTypeErrors);
- WriteMultitestToFileAndQueueIt(tests,
- outcomes,
- supportsFatalTypeErrors,
- currentKey,
- basePath,
- doTest,
- done);
+ openedFile.writeList(bytes, 0, bytes.length);
};
file.create();
}
« no previous file with comments | « tests/standalone/src/FileTest.dart ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698