a61e012e93
Move them to async_minitest. Change-Id: Ibe850b05a838dd64ae62b30c9a979de371b24db6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138741 Commit-Queue: Srujan Gaddam <srujzs@google.com> Reviewed-by: Bob Nystrom <rnystrom@google.com>
40 lines
848 B
Dart
40 lines
848 B
Dart
library fileapi;
|
|
|
|
import 'dart:async';
|
|
import 'dart:html';
|
|
|
|
import 'package:async_helper/async_helper.dart';
|
|
import 'package:async_helper/async_minitest.dart';
|
|
|
|
|
|
Future<FileSystem> _fileSystem;
|
|
|
|
Future<FileSystem> get fileSystem async {
|
|
if (_fileSystem != null) return _fileSystem;
|
|
|
|
_fileSystem = window.requestFileSystem(100);
|
|
|
|
var fs = await _fileSystem;
|
|
expect(fs != null, true);
|
|
expect(fs.root != null, true);
|
|
expect(fs.runtimeType, FileSystem);
|
|
expect(fs.root.runtimeType, DirectoryEntry);
|
|
|
|
return _fileSystem;
|
|
}
|
|
|
|
main() {
|
|
test('supported', () {
|
|
expect(FileSystem.supported, true);
|
|
});
|
|
|
|
test('requestFileSystem', () async {
|
|
var expectation = FileSystem.supported ? returnsNormally : throws;
|
|
expect(() async {
|
|
var fs = await fileSystem;
|
|
expect(fs.root != null, true);
|
|
}, expectation);
|
|
});
|
|
}
|
|
|