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

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

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 years, 8 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
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 7c0cfa0f24c8bd61f804b69d9f0ff4d167441dd4..b6efa4026d8217cc72c30956e52cd900be909acf 100644
--- a/tests/standalone/io/file_typed_data_test.dart
+++ b/tests/standalone/io/file_typed_data_test.dart
@@ -18,9 +18,8 @@ void testWriteInt8ListAndView() {
const int VIEW_LENGTH = 4;
Int8List list = new Int8List(LIST_LENGTH);
for (int i = 0; i < LIST_LENGTH; i++) list[i] = i;
- var view = new Int8List.view(list.buffer,
- OFFSET_IN_BYTES_FOR_VIEW,
- VIEW_LENGTH);
+ var view =
+ new Int8List.view(list.buffer, OFFSET_IN_BYTES_FOR_VIEW, VIEW_LENGTH);
Directory.systemTemp.createTemp('dart_file_typed_data').then((temp) {
var file = new File("${temp.path}/test");
@@ -42,7 +41,6 @@ void testWriteInt8ListAndView() {
});
}
-
void testWriteUint8ListAndView() {
asyncStart();
const int LIST_LENGTH = 8;
@@ -50,9 +48,8 @@ void testWriteUint8ListAndView() {
const int VIEW_LENGTH = 4;
Uint8List list = new Uint8List(LIST_LENGTH);
for (int i = 0; i < LIST_LENGTH; i++) list[i] = i;
- var view = new Uint8List.view(list.buffer,
- OFFSET_IN_BYTES_FOR_VIEW,
- VIEW_LENGTH);
+ var view =
+ new Uint8List.view(list.buffer, OFFSET_IN_BYTES_FOR_VIEW, VIEW_LENGTH);
Directory.systemTemp.createTemp('dart_file_typed_data').then((temp) {
var file = new File("${temp.path}/test");
@@ -74,7 +71,6 @@ void testWriteUint8ListAndView() {
});
}
-
void testWriteUint8ClampedListAndView() {
asyncStart();
const int LIST_LENGTH = 8;
@@ -82,9 +78,8 @@ void testWriteUint8ClampedListAndView() {
const int VIEW_LENGTH = 4;
Uint8ClampedList list = new Uint8ClampedList(LIST_LENGTH);
for (int i = 0; i < LIST_LENGTH; i++) list[i] = i;
- var view = new Uint8ClampedList.view(list.buffer,
- OFFSET_IN_BYTES_FOR_VIEW,
- VIEW_LENGTH);
+ var view = new Uint8ClampedList.view(
+ list.buffer, OFFSET_IN_BYTES_FOR_VIEW, VIEW_LENGTH);
Directory.systemTemp.createTemp('dart_file_typed_data').then((temp) {
var file = new File("${temp.path}/test");
@@ -106,7 +101,6 @@ void testWriteUint8ClampedListAndView() {
});
}
-
void testWriteInt16ListAndView() {
asyncStart();
const int LIST_LENGTH = 8;
@@ -116,22 +110,20 @@ void testWriteInt16ListAndView() {
const int VIEW_LENGTH_IN_BYTES = VIEW_LENGTH * Int16List.BYTES_PER_ELEMENT;
var list = new Int16List(LIST_LENGTH);
for (int i = 0; i < LIST_LENGTH; i++) list[i] = i;
- var view = new Int16List.view(list.buffer,
- OFFSET_IN_BYTES_FOR_VIEW,
- VIEW_LENGTH);
+ var view =
+ new Int16List.view(list.buffer, OFFSET_IN_BYTES_FOR_VIEW, VIEW_LENGTH);
Directory.systemTemp.createTemp('dart_file_typed_data').then((temp) {
var file = new File("${temp.path}/test");
file.open(mode: FileMode.WRITE).then((raf) {
- return raf.writeFrom(new Uint8List.view(list.buffer),
- 0,
- LIST_LENGTH_IN_BYTES);
+ return raf.writeFrom(
+ new Uint8List.view(list.buffer), 0, LIST_LENGTH_IN_BYTES);
}).then((raf) {
- return raf.writeFrom(new Uint8List.view(view.buffer,
- view.offsetInBytes,
- view.lengthInBytes),
- 0,
- VIEW_LENGTH_IN_BYTES);
+ return raf.writeFrom(
+ new Uint8List.view(
+ view.buffer, view.offsetInBytes, view.lengthInBytes),
+ 0,
+ VIEW_LENGTH_IN_BYTES);
}).then((raf) {
return raf.close();
}).then((_) {
@@ -143,15 +135,14 @@ void testWriteInt16ListAndView() {
for (int i = 0; i < content.length; i++) {
typed_data_content[i] = content[i];
}
- Expect.listEquals(expected,
- new Int16List.view(typed_data_content.buffer));
+ Expect.listEquals(
+ expected, new Int16List.view(typed_data_content.buffer));
temp.deleteSync(recursive: true);
asyncEnd();
});
});
}
-
void testWriteUint16ListAndView() {
asyncStart();
const int LIST_LENGTH = 8;
@@ -161,22 +152,20 @@ void testWriteUint16ListAndView() {
const int VIEW_LENGTH_IN_BYTES = VIEW_LENGTH * Uint16List.BYTES_PER_ELEMENT;
var list = new Uint16List(LIST_LENGTH);
for (int i = 0; i < LIST_LENGTH; i++) list[i] = i;
- var view = new Uint16List.view(list.buffer,
- OFFSET_IN_BYTES_FOR_VIEW,
- VIEW_LENGTH);
+ var view =
+ new Uint16List.view(list.buffer, OFFSET_IN_BYTES_FOR_VIEW, VIEW_LENGTH);
Directory.systemTemp.createTemp('dart_file_typed_data').then((temp) {
var file = new File("${temp.path}/test");
file.open(mode: FileMode.WRITE).then((raf) {
- return raf.writeFrom(new Uint8List.view(list.buffer),
- 0,
- LIST_LENGTH_IN_BYTES);
+ return raf.writeFrom(
+ new Uint8List.view(list.buffer), 0, LIST_LENGTH_IN_BYTES);
}).then((raf) {
- return raf.writeFrom(new Uint8List.view(view.buffer,
- view.offsetInBytes,
- view.lengthInBytes),
- 0,
- VIEW_LENGTH_IN_BYTES);
+ return raf.writeFrom(
+ new Uint8List.view(
+ view.buffer, view.offsetInBytes, view.lengthInBytes),
+ 0,
+ VIEW_LENGTH_IN_BYTES);
}).then((raf) {
return raf.close();
}).then((_) {
@@ -188,15 +177,14 @@ void testWriteUint16ListAndView() {
for (int i = 0; i < content.length; i++) {
typed_data_content[i] = content[i];
}
- Expect.listEquals(expected,
- new Uint16List.view(typed_data_content.buffer));
+ Expect.listEquals(
+ expected, new Uint16List.view(typed_data_content.buffer));
temp.deleteSync(recursive: true);
asyncEnd();
});
});
}
-
void testWriteInt32ListAndView() {
asyncStart();
const int LIST_LENGTH = 8;
@@ -206,22 +194,20 @@ void testWriteInt32ListAndView() {
const int VIEW_LENGTH_IN_BYTES = VIEW_LENGTH * Int32List.BYTES_PER_ELEMENT;
var list = new Int32List(LIST_LENGTH);
for (int i = 0; i < LIST_LENGTH; i++) list[i] = i;
- var view = new Int32List.view(list.buffer,
- OFFSET_IN_BYTES_FOR_VIEW,
- VIEW_LENGTH);
+ var view =
+ new Int32List.view(list.buffer, OFFSET_IN_BYTES_FOR_VIEW, VIEW_LENGTH);
Directory.systemTemp.createTemp('dart_file_typed_data').then((temp) {
var file = new File("${temp.path}/test");
file.open(mode: FileMode.WRITE).then((raf) {
- return raf.writeFrom(new Uint8List.view(list.buffer),
- 0,
- LIST_LENGTH_IN_BYTES);
+ return raf.writeFrom(
+ new Uint8List.view(list.buffer), 0, LIST_LENGTH_IN_BYTES);
}).then((raf) {
- return raf.writeFrom(new Uint8List.view(view.buffer,
- view.offsetInBytes,
- view.lengthInBytes),
- 0,
- VIEW_LENGTH_IN_BYTES);
+ return raf.writeFrom(
+ new Uint8List.view(
+ view.buffer, view.offsetInBytes, view.lengthInBytes),
+ 0,
+ VIEW_LENGTH_IN_BYTES);
}).then((raf) {
return raf.close();
}).then((_) {
@@ -233,15 +219,14 @@ void testWriteInt32ListAndView() {
for (int i = 0; i < content.length; i++) {
typed_data_content[i] = content[i];
}
- Expect.listEquals(expected,
- new Int32List.view(typed_data_content.buffer));
+ Expect.listEquals(
+ expected, new Int32List.view(typed_data_content.buffer));
temp.deleteSync(recursive: true);
asyncEnd();
});
});
}
-
void testWriteUint32ListAndView() {
asyncStart();
const int LIST_LENGTH = 8;
@@ -251,22 +236,20 @@ void testWriteUint32ListAndView() {
const int VIEW_LENGTH_IN_BYTES = VIEW_LENGTH * Int32List.BYTES_PER_ELEMENT;
var list = new Uint32List(LIST_LENGTH);
for (int i = 0; i < LIST_LENGTH; i++) list[i] = i;
- var view = new Uint32List.view(list.buffer,
- OFFSET_IN_BYTES_FOR_VIEW,
- VIEW_LENGTH);
+ var view =
+ new Uint32List.view(list.buffer, OFFSET_IN_BYTES_FOR_VIEW, VIEW_LENGTH);
Directory.systemTemp.createTemp('dart_file_typed_data').then((temp) {
var file = new File("${temp.path}/test");
file.open(mode: FileMode.WRITE).then((raf) {
- return raf.writeFrom(new Uint8List.view(list.buffer),
- 0,
- LIST_LENGTH_IN_BYTES);
+ return raf.writeFrom(
+ new Uint8List.view(list.buffer), 0, LIST_LENGTH_IN_BYTES);
}).then((raf) {
- return raf.writeFrom(new Uint8List.view(view.buffer,
- view.offsetInBytes,
- view.lengthInBytes),
- 0,
- VIEW_LENGTH_IN_BYTES);
+ return raf.writeFrom(
+ new Uint8List.view(
+ view.buffer, view.offsetInBytes, view.lengthInBytes),
+ 0,
+ VIEW_LENGTH_IN_BYTES);
}).then((raf) {
return raf.close();
}).then((_) {
@@ -278,15 +261,14 @@ void testWriteUint32ListAndView() {
for (int i = 0; i < content.length; i++) {
typed_data_content[i] = content[i];
}
- Expect.listEquals(expected,
- new Uint32List.view(typed_data_content.buffer));
+ Expect.listEquals(
+ expected, new Uint32List.view(typed_data_content.buffer));
temp.deleteSync(recursive: true);
asyncEnd();
});
});
}
-
void testWriteInt64ListAndView() {
asyncStart();
const int LIST_LENGTH = 8;
@@ -296,22 +278,20 @@ void testWriteInt64ListAndView() {
const int VIEW_LENGTH_IN_BYTES = VIEW_LENGTH * Int64List.BYTES_PER_ELEMENT;
var list = new Int64List(LIST_LENGTH);
for (int i = 0; i < LIST_LENGTH; i++) list[i] = i;
- var view = new Int64List.view(list.buffer,
- OFFSET_IN_BYTES_FOR_VIEW,
- VIEW_LENGTH);
+ var view =
+ new Int64List.view(list.buffer, OFFSET_IN_BYTES_FOR_VIEW, VIEW_LENGTH);
Directory.systemTemp.createTemp('dart_file_typed_data').then((temp) {
var file = new File("${temp.path}/test");
file.open(mode: FileMode.WRITE).then((raf) {
- return raf.writeFrom(new Uint8List.view(list.buffer),
- 0,
- LIST_LENGTH_IN_BYTES);
+ return raf.writeFrom(
+ new Uint8List.view(list.buffer), 0, LIST_LENGTH_IN_BYTES);
}).then((raf) {
- return raf.writeFrom(new Uint8List.view(view.buffer,
- view.offsetInBytes,
- view.lengthInBytes),
- 0,
- VIEW_LENGTH_IN_BYTES);
+ return raf.writeFrom(
+ new Uint8List.view(
+ view.buffer, view.offsetInBytes, view.lengthInBytes),
+ 0,
+ VIEW_LENGTH_IN_BYTES);
}).then((raf) {
return raf.close();
}).then((_) {
@@ -323,15 +303,14 @@ void testWriteInt64ListAndView() {
for (int i = 0; i < content.length; i++) {
typed_data_content[i] = content[i];
}
- Expect.listEquals(expected,
- new Int64List.view(typed_data_content.buffer));
+ Expect.listEquals(
+ expected, new Int64List.view(typed_data_content.buffer));
temp.deleteSync(recursive: true);
asyncEnd();
});
});
}
-
void testWriteUint64ListAndView() {
asyncStart();
const int LIST_LENGTH = 8;
@@ -341,22 +320,20 @@ void testWriteUint64ListAndView() {
const int VIEW_LENGTH_IN_BYTES = VIEW_LENGTH * Uint64List.BYTES_PER_ELEMENT;
var list = new Uint64List(LIST_LENGTH);
for (int i = 0; i < LIST_LENGTH; i++) list[i] = i;
- var view = new Uint64List.view(list.buffer,
- OFFSET_IN_BYTES_FOR_VIEW,
- VIEW_LENGTH);
+ var view =
+ new Uint64List.view(list.buffer, OFFSET_IN_BYTES_FOR_VIEW, VIEW_LENGTH);
Directory.systemTemp.createTemp('dart_file_typed_data').then((temp) {
var file = new File("${temp.path}/test");
file.open(mode: FileMode.WRITE).then((raf) {
- return raf.writeFrom(new Uint8List.view(list.buffer),
- 0,
- LIST_LENGTH_IN_BYTES);
+ return raf.writeFrom(
+ new Uint8List.view(list.buffer), 0, LIST_LENGTH_IN_BYTES);
}).then((raf) {
- return raf.writeFrom(new Uint8List.view(view.buffer,
- view.offsetInBytes,
- view.lengthInBytes),
- 0,
- VIEW_LENGTH_IN_BYTES);
+ return raf.writeFrom(
+ new Uint8List.view(
+ view.buffer, view.offsetInBytes, view.lengthInBytes),
+ 0,
+ VIEW_LENGTH_IN_BYTES);
}).then((raf) {
return raf.close();
}).then((_) {
@@ -368,15 +345,14 @@ void testWriteUint64ListAndView() {
for (int i = 0; i < content.length; i++) {
typed_data_content[i] = content[i];
}
- Expect.listEquals(expected,
- new Uint64List.view(typed_data_content.buffer));
+ Expect.listEquals(
+ expected, new Uint64List.view(typed_data_content.buffer));
temp.deleteSync(recursive: true);
asyncEnd();
});
});
}
-
main() {
testWriteInt8ListAndView();
testWriteUint8ListAndView();

Powered by Google App Engine
This is Rietveld 408576698