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

Side by Side Diff: tests/standalone/coverage_test.dart

Issue 22872012: Remove Encoding-enum from dart:io and add interface in dart:convert. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix typo. Created 7 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
« no previous file with comments | « tests/lib/convert/encoding_test.dart ('k') | tests/standalone/debugger/debug_lib.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // This test forks a second vm process that runs the script tools/coverage.dart 5 // This test forks a second vm process that runs the script tools/coverage.dart
6 // and verifies that the coverage tool produces its expected output. 6 // and verifies that the coverage tool produces its expected output.
7 // This test is mainly here to ensure that the coverage tool compiles and 7 // This test is mainly here to ensure that the coverage tool compiles and
8 // runs. 8 // runs.
9 9
10 import "dart:async"; 10 import "dart:async";
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 sourceLines = new File(targPath).readAsLinesSync(); 59 sourceLines = new File(targPath).readAsLinesSync();
60 assert(sourceLines != null); 60 assert(sourceLines != null);
61 61
62 var processOpts = [ "--compile_all", toolPath, targPath ]; 62 var processOpts = [ "--compile_all", toolPath, targPath ];
63 63
64 Process.start(Platform.executable, processOpts).then((Process process) { 64 Process.start(Platform.executable, processOpts).then((Process process) {
65 coverageToolProcess = process; 65 coverageToolProcess = process;
66 coverageToolProcess.stdin.close(); 66 coverageToolProcess.stdin.close();
67 var stdoutStringStream = coverageToolProcess.stdout 67 var stdoutStringStream = coverageToolProcess.stdout
68 .transform(new StringDecoder()) 68 .transform(UTF8.decoder)
69 .transform(new LineSplitter()); 69 .transform(new LineSplitter());
70 70
71 var stderrStringStream = coverageToolProcess.stderr 71 var stderrStringStream = coverageToolProcess.stderr
72 .transform(new StringDecoder()) 72 .transform(UTF8.decoder)
73 .transform(new LineSplitter()); 73 .transform(new LineSplitter());
74 74
75 // Wait for 3 future events: stdout and stderr streams of the coverage 75 // Wait for 3 future events: stdout and stderr streams of the coverage
76 // tool process closed, and coverage tool process terminated. 76 // tool process closed, and coverage tool process terminated.
77 var futures = []; 77 var futures = [];
78 var subscription = stdoutStringStream.listen(onCoverageOutput); 78 var subscription = stdoutStringStream.listen(onCoverageOutput);
79 futures.add(subscription.asFuture(true)); 79 futures.add(subscription.asFuture(true));
80 subscription = stderrStringStream.listen(onCoverageOutput); 80 subscription = stderrStringStream.listen(onCoverageOutput);
81 futures.add(subscription.asFuture(true)); 81 futures.add(subscription.asFuture(true));
82 futures.add(coverageToolProcess.exitCode.then(checkExitCode)); 82 futures.add(coverageToolProcess.exitCode.then(checkExitCode));
83 Future.wait(futures).then((results) { 83 Future.wait(futures).then((results) {
84 checkSuccess(); 84 checkSuccess();
85 if (results.contains(false)) exit(-1); 85 if (results.contains(false)) exit(-1);
86 }); 86 });
87 }); 87 });
88 } 88 }
OLDNEW
« no previous file with comments | « tests/lib/convert/encoding_test.dart ('k') | tests/standalone/debugger/debug_lib.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698