| Index: dart/tools/testing/dart/test_suite.dart
|
| diff --git a/dart/tools/testing/dart/test_suite.dart b/dart/tools/testing/dart/test_suite.dart
|
| index 5f5e4efcaa360373ec23960e9c920440d88bcd38..1a9f4e13874f8f2bddfe96bd81859946a468d498 100644
|
| --- a/dart/tools/testing/dart/test_suite.dart
|
| +++ b/dart/tools/testing/dart/test_suite.dart
|
| @@ -15,6 +15,7 @@
|
| library test_suite;
|
|
|
| import "dart:async";
|
| +import "dart:convert" show LineSplitter, UTF8;
|
| import "dart:io";
|
| import "dart:isolate";
|
| import "drt_updater.dart";
|
| @@ -260,8 +261,8 @@ void ccTestLister() {
|
| // Drain stderr to not leak resources.
|
| p.stderr.listen((_) { });
|
| Stream<String> stdoutStream =
|
| - p.stdout.transform(new StringDecoder())
|
| - .transform(new LineTransformer());
|
| + p.stdout.transform(UTF8.decoder)
|
| + .transform(new LineSplitter());
|
| var streamDone = false;
|
| var processExited = false;
|
| checkDone() {
|
| @@ -573,7 +574,7 @@ class StandardTestSuite extends TestSuite {
|
| if (statusFilePath.endsWith('_dart2js.status') ||
|
| statusFilePath.endsWith('_analyzer.status') ||
|
| statusFilePath.endsWith('_analyzer2.status')) {
|
| - var file = new File.fromPath(dartDir.append(statusFilePath));
|
| + var file = new File(dartDir.append(statusFilePath).toNativePath());
|
| if (!file.existsSync()) {
|
| filesRead++;
|
| continue;
|
| @@ -589,7 +590,7 @@ class StandardTestSuite extends TestSuite {
|
| }
|
|
|
| Future enqueueTests() {
|
| - Directory dir = new Directory.fromPath(suiteDir);
|
| + Directory dir = new Directory(suiteDir.toNativePath());
|
| return dir.exists().then((exists) {
|
| if (!exists) {
|
| print('Directory containing tests missing: ${suiteDir.toNativePath()}');
|
| @@ -970,10 +971,10 @@ class StandardTestSuite extends TestSuite {
|
| Path pngPath = dir.append('$nameNoExt.png');
|
| Path txtPath = dir.append('$nameNoExt.txt');
|
| Path expectedOutput = null;
|
| - if (new File.fromPath(pngPath).existsSync()) {
|
| + if (new File(pngPath.toNativePath()).existsSync()) {
|
| expectedOutput = pngPath;
|
| content = getHtmlLayoutContents(scriptType, new Path("$scriptPath"));
|
| - } else if (new File.fromPath(txtPath).existsSync()) {
|
| + } else if (new File(txtPath.toNativePath()).existsSync()) {
|
| expectedOutput = txtPath;
|
| content = getHtmlLayoutContents(scriptType, new Path("$scriptPath"));
|
| } else {
|
| @@ -1008,7 +1009,7 @@ class StandardTestSuite extends TestSuite {
|
| // For the tests that require multiple input scripts but are not
|
| // compiled, move the input scripts over with the script so they can
|
| // be accessed.
|
| - String result = new File.fromPath(fromPath).readAsStringSync();
|
| + String result = new File(fromPath.toNativePath()).readAsStringSync();
|
| new File('$tempDir/$baseName.dart').writeAsStringSync(result);
|
| }
|
| }
|
| @@ -1161,7 +1162,7 @@ class StandardTestSuite extends TestSuite {
|
| .append(testUniqueName);
|
|
|
| TestUtils.mkdirRecursive(new Path('.'), generatedTestPath);
|
| - return new File.fromPath(generatedTestPath).fullPathSync()
|
| + return new File(generatedTestPath.toNativePath()).fullPathSync()
|
| .replaceAll('\\', '/');
|
| }
|
|
|
| @@ -1347,7 +1348,7 @@ class StandardTestSuite extends TestSuite {
|
| new RegExp(r"^[#]?import.*dart:(html|web_audio|indexed_db|svg|web_sql)",
|
| multiLine: true);
|
|
|
| - var bytes = new File.fromPath(filePath).readAsBytesSync();
|
| + var bytes = new File(filePath.toNativePath()).readAsBytesSync();
|
| String contents = decodeUtf8(bytes);
|
| bytes = null;
|
|
|
| @@ -1473,7 +1474,8 @@ class StandardTestSuite extends TestSuite {
|
| * environment variables, configuration files, etc.
|
| */
|
| Map readOptionsFromCo19File(Path filePath) {
|
| - String contents = decodeUtf8(new File.fromPath(filePath).readAsBytesSync());
|
| + String contents = decodeUtf8(new File(filePath.toNativePath())
|
| + .readAsBytesSync());
|
|
|
| bool hasCompileError = contents.contains("@compile-error");
|
| bool hasRuntimeError = contents.contains("@runtime-error");
|
| @@ -1546,7 +1548,7 @@ class DartcCompilationTestSuite extends StandardTestSuite {
|
| var group = new FutureGroup();
|
|
|
| for (String testDir in _testDirs) {
|
| - Directory dir = new Directory.fromPath(suiteDir.append(testDir));
|
| + Directory dir = new Directory(suiteDir.append(testDir).toNativePath());
|
| if (dir.existsSync()) {
|
| enqueueDirectory(dir, group);
|
| }
|
| @@ -1720,7 +1722,7 @@ class TestUtils {
|
| if (relativePath.isAbsolute) {
|
| base = new Path('/');
|
| }
|
| - Directory dir = new Directory.fromPath(base);
|
| + Directory dir = new Directory(base.toNativePath());
|
| assert(dir.existsSync());
|
| var segments = relativePath.segments();
|
| for (String segment in segments) {
|
| @@ -1731,7 +1733,7 @@ class TestUtils {
|
| // Skip the directory creation for a path like "/E:".
|
| continue;
|
| }
|
| - dir = new Directory.fromPath(base);
|
| + dir = new Directory(base.toNativePath());
|
| if (!dir.existsSync()) {
|
| dir.createSync();
|
| }
|
| @@ -1745,8 +1747,8 @@ class TestUtils {
|
| * Assumes that the directory for [dest] already exists.
|
| */
|
| static Future copyFile(Path source, Path dest) {
|
| - return new File.fromPath(source).openRead()
|
| - .pipe(new File.fromPath(dest).openWrite());
|
| + return new File(source.toNativePath()).openRead()
|
| + .pipe(new File(dest.toNativePath()).openWrite());
|
| }
|
|
|
| static Path debugLogfile() {
|
|
|