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

Unified Diff: tests/standalone/src/ProcessStartExceptionTest.dart

Issue 9024008: Change the process API to be completely asynchronous. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Presubmit fixes 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
Index: tests/standalone/src/ProcessStartExceptionTest.dart
diff --git a/tests/standalone/src/ProcessStartExceptionTest.dart b/tests/standalone/src/ProcessStartExceptionTest.dart
index 1446ee87f7f698bcc26c135d620bc51447e88ee6..fc0b0dbbc907e1ad05234b78325d6ed6337f9b18 100644
--- a/tests/standalone/src/ProcessStartExceptionTest.dart
+++ b/tests/standalone/src/ProcessStartExceptionTest.dart
@@ -6,32 +6,23 @@
class ProcessStartExceptionTest {
- static void testStartException() {
+ static void testStartError() {
Process process =
- new Process("__path_to_something_that_hopefully_does_not_exist__",
- const []);
+ new Process.start("__path_to_something_that_should_not_exist__",
+ const []);
- void exitHandler(int exitCode) {
- exitHandlerCalled = false;
- }
+ process.exitHandler = (int exitCode) {
+ Expect.fail("exit handler called");
+ };
- process.exitHandler = exitHandler;
- try {
- process.start();
- } catch (ProcessException e) {
- errorCode = e.errorCode;
- }
+ process.errorHandler = (ProcessException e) {
+ Expect.equals(2, e.errorCode);
+ };
}
static void testMain() {
- exitHandlerCalled = false;
- testStartException();
- Expect.equals(2, errorCode);
- Expect.equals(false, exitHandlerCalled);
+ testStartError();
}
-
- static int errorCode;
- static bool exitHandlerCalled;
}
main() {

Powered by Google App Engine
This is Rietveld 408576698