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

Side by Side Diff: tests/standalone/src/io/DirectoryTest.dart

Issue 9652001: SendPort + ReceivePort changes: (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // Directory listing test. 5 // Directory listing test.
6 6
7 #import("dart:io"); 7 #import("dart:io");
8 #import("dart:isolate"); 8 #import("dart:isolate");
9 9
10 class DirectoryTest { 10 class DirectoryTest {
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 Expect.throws(new Directory(location).createTempSync, 441 Expect.throws(new Directory(location).createTempSync,
442 (e) => e is DirectoryException); 442 (e) => e is DirectoryException);
443 } 443 }
444 } 444 }
445 445
446 446
447 testCreateTempError() { 447 testCreateTempError() {
448 var location = illegalTempDirectoryLocation(); 448 var location = illegalTempDirectoryLocation();
449 if (location == null) return; 449 if (location == null) return;
450 450
451 var resultPort = new ReceivePort.singleShot(); 451 var resultPort = new ReceivePort();
452 resultPort.receive((String message, ignored) { 452 resultPort.receive((String message, ignored) {
453 resultPort.close();
453 Expect.equals("error", message); 454 Expect.equals("error", message);
454 }); 455 });
455 456
456 Directory dir = new Directory(location); 457 Directory dir = new Directory(location);
457 dir.onError = (error) { resultPort.toSendPort().send("error"); }; 458 dir.onError = (error) { resultPort.toSendPort().send("error"); };
458 dir.createTemp(() => resultPort.toSendPort().send("success")); 459 dir.createTemp(() => resultPort.toSendPort().send("success"));
459 } 460 }
460 461
461 462
462 main() { 463 main() {
463 DirectoryTest.testMain(); 464 DirectoryTest.testMain();
464 NestedTempDirectoryTest.testMain(); 465 NestedTempDirectoryTest.testMain();
465 testCreateTempErrorSync(); 466 testCreateTempErrorSync();
466 testCreateTempError(); 467 testCreateTempError();
467 } 468 }
OLDNEW
« no previous file with comments | « tests/language/src/TypedMessageTest.dart ('k') | tests/standalone/src/io/FileInputStreamTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698