// Copyright (c) 2011, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
//
// Directory listing test.

class DirectoryTest {
  static void testListing() {
    bool listedSomething = false;
    Directory directory = new Directory.open(".");

    directory.setDirHandler((dir) {
      listedSomething = true;
    });

    directory.setFileHandler((f) {
      listedSomething = true;
    });

    directory.setDoneHandler((completed) {
      Expect.isTrue(completed, "directory listing did not complete");
      Expect.isTrue(listedSomething, "empty directory");
      directory.close();
    });

    directory.setDirErrorHandler((dir) {
      Expect.fail("error listing directory");
    });

    directory.list();
  }

  static void testMain() {
    testListing();
  }
}

main() {
  DirectoryTest.testMain();
}

Add simple directory listing test.
Add simple directory listing test.

For now, just test that we list something and that no errors occur.

R=sgjesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8222006

git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@299 260f80e4-7a28-3924-810f-c04153c831b5
