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

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

Issue 8386029: Consistently use setters to set event handlers in native APIs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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/DirectoryTest.dart
diff --git a/tests/standalone/src/DirectoryTest.dart b/tests/standalone/src/DirectoryTest.dart
index 3892cd029556c878d3503eb23d67a196d2312a9a..6056aea8ebca75151865d9ced37719bf86323efc 100644
--- a/tests/standalone/src/DirectoryTest.dart
+++ b/tests/standalone/src/DirectoryTest.dart
@@ -9,22 +9,22 @@ class DirectoryTest {
bool listedSomething = false;
Directory directory = new Directory(".");
- directory.setDirHandler((dir) {
+ directory.dirHandler = (dir) {
listedSomething = true;
- });
+ };
- directory.setFileHandler((f) {
+ directory.fileHandler = (f) {
listedSomething = true;
- });
+ };
- directory.setDoneHandler((completed) {
+ directory.doneHandler = (completed) {
Expect.isTrue(completed, "directory listing did not complete");
Expect.isTrue(listedSomething, "empty directory");
- });
+ };
- directory.setErrorHandler((error) {
+ directory.errorHandler = (error) {
Expect.fail("error listing directory: $error");
- });
+ };
directory.list();
@@ -36,11 +36,11 @@ class DirectoryTest {
static void testExistsCreateDelete() {
// TODO(ager): This should be creating temporary directories.
Directory d = new Directory("____DIRECTORY_TEST_DIRECTORY____");
- Expect.isFalse(d.exists());
- d.create();
- Expect.isTrue(d.exists());
- d.delete();
- Expect.isFalse(d.exists());
+ Expect.isFalse(d.existsSync());
+ d.createSync();
+ Expect.isTrue(d.existsSync());
+ d.deleteSync();
+ Expect.isFalse(d.existsSync());
}
static void testMain() {
« no previous file with comments | « tests/standalone/src/DirectoryInvalidArgumentsTest.dart ('k') | tests/standalone/src/EchoServerStreamTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698