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

Unified Diff: tests/html/fileapi_test.dart

Issue 10544167: Some unit test fixes (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/html/cssstyledeclaration_test.dart ('k') | tests/html/html.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/fileapi_test.dart
===================================================================
--- tests/html/fileapi_test.dart (revision 8732)
+++ tests/html/fileapi_test.dart (working copy)
@@ -7,60 +7,54 @@
useHtmlConfiguration();
window.webkitRequestFileSystem(Window.TEMPORARY, 100, (fs) {
// FIXME: add types to callback arguments after migration to wrapperless dart:html.
- asyncTest('getDirectory', 2, () {
- Expect.throws(() => fs.root.getDirectory('directory1', {'x': true}, (e) {}));
+ test('getDirectory', () {
+ expect(() => fs.root.getDirectory('directory1', {'x': true}, (e) {}),
+ throws);
+
fs.root.getDirectory(
'directory2',
flags: {},
- successCallback: (e) {
- Expect.fail('Should not be reached');
- callbackDone();
- },
- errorCallback: (e) {
- Expect.equals(FileError.NOT_FOUND_ERR, e.code);
- callbackDone();
- });
+ successCallback: expectAsync1((e) {
+ expect(false, 'Should not be reached');
+ }, count:0),
+ errorCallback: expectAsync1((e) {
+ expect(e.code, equals(FileError.NOT_FOUND_ERR));
+ }));
fs.root.getDirectory(
'directory3',
flags: {'create': true},
- successCallback: (e) {
- Expect.equals('directory3', e.name);
- callbackDone();
- },
- errorCallback: (e) {
- Expect.fail('Got file error: ${e.code}');
- callbackDone();
- });
+ successCallback: expectAsync1((e) {
+ expect(e.name, equals('directory3'));
+ }),
+ errorCallback: expectAsync1((e) {
+ expect(false, 'Got file error: ${e.code}');
+ }, count:0));
});
- asyncTest('getFile', 2, () {
- Expect.throws(() => fs.root.getFile('file1', {'x': true}, (e) {}));
+ test('getFile', () {
+ expect(() => fs.root.getFile('file1', {'x': true}, (e) {}), throws);
fs.root.getDirectory(
'file2',
flags: {},
- successCallback: (e) {
- Expect.fail('Should not be reached');
- callbackDone();
- },
- errorCallback: (e) {
- Expect.equals(FileError.NOT_FOUND_ERR, e.code);
- callbackDone();
- });
+ successCallback: expectAsync1((e) {
+ expect(false, 'Should not be reached');
+ }, count:0),
+ errorCallback: expectAsync1((e) {
+ expect(e.code, equals(FileError.NOT_FOUND_ERR));
+ }));
fs.root.getDirectory(
'file3',
flags: {'create': true},
- successCallback: (e) {
- Expect.equals('file3', e.name);
- callbackDone();
- },
- errorCallback: (e) {
- Expect.fail('Got file error: ${e.code}');
- callbackDone();
- });
+ successCallback: expectAsync1((e) {
+ expect(e.name, equals('file3'));
+ }),
+ errorCallback: expectAsync1((e) {
+ expect(false, 'Got file error: ${e.code}');
+ }, count:0));
});
});
}
« no previous file with comments | « tests/html/cssstyledeclaration_test.dart ('k') | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698