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

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: Add binaries. 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
« no previous file with comments | « tests/standalone/src/ProcessSegfaultTest.dart ('k') | tests/standalone/src/ProcessStderrTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/ProcessStartExceptionTest.dart
diff --git a/tests/standalone/src/ProcessStartExceptionTest.dart b/tests/standalone/src/ProcessStartExceptionTest.dart
index 1446ee87f7f698bcc26c135d620bc51447e88ee6..ef63a7beda9d5b5242b13fbd5764745e98845239 100644
--- a/tests/standalone/src/ProcessStartExceptionTest.dart
+++ b/tests/standalone/src/ProcessStartExceptionTest.dart
@@ -6,34 +6,21 @@
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);
- }
-
- static int errorCode;
- static bool exitHandlerCalled;
}
main() {
- ProcessStartExceptionTest.testMain();
+ ProcessStartExceptionTest.testStartError();
}
« no previous file with comments | « tests/standalone/src/ProcessSegfaultTest.dart ('k') | tests/standalone/src/ProcessStderrTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698