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

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

Issue 10837070: Remove old isolate API and update all code in the repository to use (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/standalone/io/testing_server.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_suite.dart
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index b82812c98d5a2f37ba1af86a88f76e2c9b4626d6..d2ce8543459aaf254b5dce26b5f08716c9c1fafa 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -55,38 +55,34 @@ interface TestSuite {
bool Contains(element, collection) => collection.indexOf(element) >= 0;
-class CCTestListerIsolate extends Isolate {
- CCTestListerIsolate() : super.heavy();
-
- void main() {
- port.receive((String runnerPath, SendPort replyTo) {
- var p = Process.start(runnerPath, ["--list"]);
- StringInputStream stdoutStream = new StringInputStream(p.stdout);
- List<String> tests = new List<String>();
- stdoutStream.onLine = () {
- String line = stdoutStream.readLine();
- while (line != null) {
- tests.add(line);
- line = stdoutStream.readLine();
- }
- };
- p.onError = (error) {
+void ccTestLister() {
+ port.receive((String runnerPath, SendPort replyTo) {
+ var p = Process.start(runnerPath, ["--list"]);
+ StringInputStream stdoutStream = new StringInputStream(p.stdout);
+ List<String> tests = new List<String>();
+ stdoutStream.onLine = () {
+ String line = stdoutStream.readLine();
+ while (line != null) {
+ tests.add(line);
+ line = stdoutStream.readLine();
+ }
+ };
+ p.onError = (error) {
+ print("Failed to list tests: $runnerPath --list");
+ replyTo.send("");
+ };
+ p.onExit = (code) {
+ if (code < 0) {
print("Failed to list tests: $runnerPath --list");
replyTo.send("");
- };
- p.onExit = (code) {
- if (code < 0) {
- print("Failed to list tests: $runnerPath --list");
- replyTo.send("");
- }
- for (String test in tests) {
- replyTo.send(test);
- }
- replyTo.send("");
- };
- port.close();
- });
- }
+ }
+ for (String test in tests) {
+ replyTo.send(test);
+ }
+ replyTo.send("");
+ };
+ port.close();
+ });
}
@@ -161,10 +157,9 @@ class CCTestSuite implements TestSuite {
filesRead++;
if (filesRead == statusFilePaths.length) {
receiveTestName = new ReceivePort();
- new CCTestListerIsolate().spawn().then((port) {
- port.send(runnerPath, receiveTestName.toSendPort());
- receiveTestName.receive(testNameHandler);
- });
+ var port = spawnFunction(ccTestLister);
+ port.send(runnerPath, receiveTestName.toSendPort());
+ receiveTestName.receive(testNameHandler);
}
}
« no previous file with comments | « tests/standalone/io/testing_server.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698