| OLD | NEW |
| 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 import "dart:io"; | 5 import "dart:io"; |
| 6 import "dart:isolate"; | 6 import "dart:isolate"; |
| 7 import "dart:async"; | 7 import "dart:async"; |
| 8 import "../../../tools/testing/dart/test_runner.dart"; | 8 import "../../../tools/testing/dart/test_runner.dart"; |
| 9 import "../../../tools/testing/dart/test_suite.dart"; | 9 import "../../../tools/testing/dart/test_suite.dart"; |
| 10 import "../../../tools/testing/dart/test_progress.dart" as progress; | 10 import "../../../tools/testing/dart/test_progress.dart" as progress; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 return new TestCase(name, | 106 return new TestCase(name, |
| 107 [command], | 107 [command], |
| 108 configuration, | 108 configuration, |
| 109 new Set<Expectation>.from(expectations)); | 109 new Set<Expectation>.from(expectations)); |
| 110 } | 110 } |
| 111 } | 111 } |
| 112 | 112 |
| 113 void testProcessQueue() { | 113 void testProcessQueue() { |
| 114 var maxProcesses = 2; | 114 var maxProcesses = 2; |
| 115 var maxBrowserProcesses = maxProcesses; | 115 var maxBrowserProcesses = maxProcesses; |
| 116 new ProcessQueue({'noBatch' : true}, maxProcesses, maxBrowserProcesses, | 116 var config = new TestOptionsParser().parse(['--nobatch'])[0]; |
| 117 new ProcessQueue(config, maxProcesses, maxBrowserProcesses, |
| 117 new DateTime.now(), [new CustomTestSuite()], | 118 new DateTime.now(), [new CustomTestSuite()], |
| 118 [new EventListener()], TestController.finished); | 119 [new EventListener()], TestController.finished); |
| 119 } | 120 } |
| 120 | 121 |
| 121 class EventListener extends progress.EventListener{ | 122 class EventListener extends progress.EventListener{ |
| 122 void done(TestCase test) { | 123 void done(TestCase test) { |
| 123 TestController.processCompletedTest(test); | 124 TestController.processCompletedTest(test); |
| 124 } | 125 } |
| 125 } | 126 } |
| 126 | 127 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 141 break; | 142 break; |
| 142 case 'timeout': | 143 case 'timeout': |
| 143 // Run for 10 seconds, then exit. This tests a 2 second timeout. | 144 // Run for 10 seconds, then exit. This tests a 2 second timeout. |
| 144 new Timer(new Duration(seconds: 10), (){ }); | 145 new Timer(new Duration(seconds: 10), (){ }); |
| 145 break; | 146 break; |
| 146 default: | 147 default: |
| 147 throw "Unknown option ${arguments[0]} passed to test_runner_test"; | 148 throw "Unknown option ${arguments[0]} passed to test_runner_test"; |
| 148 } | 149 } |
| 149 } | 150 } |
| 150 } | 151 } |
| OLD | NEW |