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

Unified Diff: tests/standalone/io/file_typed_data_test.dart

Issue 23886004: Update dart:io tests to use asyncStart/asyncEnd (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 7 years, 3 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/standalone/io/file_test.dart ('k') | tests/standalone/io/file_write_as_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/file_typed_data_test.dart
diff --git a/tests/standalone/io/file_typed_data_test.dart b/tests/standalone/io/file_typed_data_test.dart
index 90e89b630f1704cd3c778043a439b4308026dec5..0dee529fa9013a1f979179771da68b3efa1bcc84 100644
--- a/tests/standalone/io/file_typed_data_test.dart
+++ b/tests/standalone/io/file_typed_data_test.dart
@@ -4,14 +4,15 @@
//
// Dart test program for testing file I/O.
-import "package:expect/expect.dart";
import 'dart:async';
import 'dart:io';
-import 'dart:isolate';
import 'dart:typed_data';
+import "package:async_helper/async_helper.dart";
+import "package:expect/expect.dart";
+
void testWriteInt8ListAndView() {
- ReceivePort port = new ReceivePort();
+ asyncStart();
const int LIST_LENGTH = 8;
const int OFFSET_IN_BYTES_FOR_VIEW = 2 * Int8List.BYTES_PER_ELEMENT;
const int VIEW_LENGTH = 4;
@@ -36,14 +37,14 @@ void testWriteInt8ListAndView() {
var content = file.readAsBytesSync();
Expect.listEquals(expected, content);
temp.deleteSync(recursive: true);
- port.close();
+ asyncEnd();
});
});
}
void testWriteUint8ListAndView() {
- ReceivePort port = new ReceivePort();
+ asyncStart();
const int LIST_LENGTH = 8;
const int OFFSET_IN_BYTES_FOR_VIEW = 2 * Uint8List.BYTES_PER_ELEMENT;
const int VIEW_LENGTH = 4;
@@ -68,14 +69,14 @@ void testWriteUint8ListAndView() {
var content = file.readAsBytesSync();
Expect.listEquals(expected, content);
temp.deleteSync(recursive: true);
- port.close();
+ asyncEnd();
});
});
}
void testWriteUint8ClampedListAndView() {
- ReceivePort port = new ReceivePort();
+ asyncStart();
const int LIST_LENGTH = 8;
const int OFFSET_IN_BYTES_FOR_VIEW = 2 * Uint8ClampedList.BYTES_PER_ELEMENT;
const int VIEW_LENGTH = 4;
@@ -100,14 +101,14 @@ void testWriteUint8ClampedListAndView() {
var content = file.readAsBytesSync();
Expect.listEquals(expected, content);
temp.deleteSync(recursive: true);
- port.close();
+ asyncEnd();
});
});
}
void testWriteInt16ListAndView() {
- ReceivePort port = new ReceivePort();
+ asyncStart();
const int LIST_LENGTH = 8;
const int LIST_LENGTH_IN_BYTES = LIST_LENGTH * Int16List.BYTES_PER_ELEMENT;
const int OFFSET_IN_BYTES_FOR_VIEW = 2 * Int16List.BYTES_PER_ELEMENT;
@@ -144,14 +145,14 @@ void testWriteInt16ListAndView() {
}
Expect.listEquals(expected, new Int16List.view(typed_data_content));
temp.deleteSync(recursive: true);
- port.close();
+ asyncEnd();
});
});
}
void testWriteUint16ListAndView() {
- ReceivePort port = new ReceivePort();
+ asyncStart();
const int LIST_LENGTH = 8;
const int LIST_LENGTH_IN_BYTES = LIST_LENGTH * Uint16List.BYTES_PER_ELEMENT;
const int OFFSET_IN_BYTES_FOR_VIEW = 2 * Uint16List.BYTES_PER_ELEMENT;
@@ -188,14 +189,14 @@ void testWriteUint16ListAndView() {
}
Expect.listEquals(expected, new Uint16List.view(typed_data_content));
temp.deleteSync(recursive: true);
- port.close();
+ asyncEnd();
});
});
}
void testWriteInt32ListAndView() {
- ReceivePort port = new ReceivePort();
+ asyncStart();
const int LIST_LENGTH = 8;
const int LIST_LENGTH_IN_BYTES = LIST_LENGTH * Int32List.BYTES_PER_ELEMENT;
const int OFFSET_IN_BYTES_FOR_VIEW = 2 * Int32List.BYTES_PER_ELEMENT;
@@ -232,14 +233,14 @@ void testWriteInt32ListAndView() {
}
Expect.listEquals(expected, new Int32List.view(typed_data_content));
temp.deleteSync(recursive: true);
- port.close();
+ asyncEnd();
});
});
}
void testWriteUint32ListAndView() {
- ReceivePort port = new ReceivePort();
+ asyncStart();
const int LIST_LENGTH = 8;
const int LIST_LENGTH_IN_BYTES = LIST_LENGTH * Int32List.BYTES_PER_ELEMENT;
const int OFFSET_IN_BYTES_FOR_VIEW = 2 * Int32List.BYTES_PER_ELEMENT;
@@ -276,14 +277,14 @@ void testWriteUint32ListAndView() {
}
Expect.listEquals(expected, new Uint32List.view(typed_data_content));
temp.deleteSync(recursive: true);
- port.close();
+ asyncEnd();
});
});
}
void testWriteInt64ListAndView() {
- ReceivePort port = new ReceivePort();
+ asyncStart();
const int LIST_LENGTH = 8;
const int LIST_LENGTH_IN_BYTES = LIST_LENGTH * Int64List.BYTES_PER_ELEMENT;
const int OFFSET_IN_BYTES_FOR_VIEW = 2 * Int64List.BYTES_PER_ELEMENT;
@@ -320,14 +321,14 @@ void testWriteInt64ListAndView() {
}
Expect.listEquals(expected, new Int64List.view(typed_data_content));
temp.deleteSync(recursive: true);
- port.close();
+ asyncEnd();
});
});
}
void testWriteUint64ListAndView() {
- ReceivePort port = new ReceivePort();
+ asyncStart();
const int LIST_LENGTH = 8;
const int LIST_LENGTH_IN_BYTES = LIST_LENGTH * Uint64List.BYTES_PER_ELEMENT;
const int OFFSET_IN_BYTES_FOR_VIEW = 2 * Uint64List.BYTES_PER_ELEMENT;
@@ -364,7 +365,7 @@ void testWriteUint64ListAndView() {
}
Expect.listEquals(expected, new Uint64List.view(typed_data_content));
temp.deleteSync(recursive: true);
- port.close();
+ asyncEnd();
});
});
}
« no previous file with comments | « tests/standalone/io/file_test.dart ('k') | tests/standalone/io/file_write_as_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698