ef6273cba0
This is a migration of 13 Chrome release about 1.5 years of Chrome releases. Update PYTHON scripts for cleaner and easier rolling. Here's a doc on the changes that might affect Dart users: https://docs.google.com/document/d/1Kj0nk3SueO3JKub8im7z3znu9j5oiI7vf49ejZrMxuE/edit# Change-Id: I768fbd09b04fe6884af36ac102d5813f67bae426 Reviewed-on: https://dart-review.googlesource.com/24501 Commit-Queue: Terry Lucas <terry@google.com> Reviewed-by: Terry Lucas <terry@google.com>
47 lines
929 B
Dart
47 lines
929 B
Dart
library fileapi;
|
|
|
|
|
|
import 'dart:async';
|
|
import 'dart:html';
|
|
|
|
import 'package:unittest/unittest.dart';
|
|
import 'package:unittest/html_config.dart';
|
|
import 'package:async_helper/async_helper.dart';
|
|
|
|
class FileAndDir {
|
|
FileEntry file;
|
|
DirectoryEntry dir;
|
|
FileAndDir(this.file, this.dir);
|
|
}
|
|
|
|
FileSystem fs;
|
|
|
|
main() async {
|
|
useHtmlConfiguration();
|
|
|
|
getFileSystem() async {
|
|
var fileSystem = await window.requestFileSystem(100);
|
|
fs = fileSystem;
|
|
}
|
|
|
|
if (FileSystem.supported) {
|
|
await getFileSystem();
|
|
|
|
test('directoryDoesntExist', () async {
|
|
try {
|
|
await fs.root.getDirectory('directory2');
|
|
} catch (error) {
|
|
expect(true, error is DomException);
|
|
expect(DomException.NOT_FOUND, error.name);
|
|
}
|
|
});
|
|
|
|
test('directoryCreate', () async {
|
|
var entry = await fs.root.createDirectory('directory3');
|
|
expect(entry.name, equals('directory3'));
|
|
});
|
|
}
|
|
|
|
}
|
|
|