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

Unified Diff: tests/html/typed_arrays_1_test.dart

Issue 14367012: Move to new dart:typeddata types for dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revert generated files for html lib Created 7 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/html/typed_arrays_1_test.dart
diff --git a/tests/html/typed_arrays_1_test.dart b/tests/html/typed_arrays_1_test.dart
index 52cd41b282e6569dece7c7bf7a01c7d0cb15ea96..1c791a184ea40fe083412532c5f360b5f487138a 100644
--- a/tests/html/typed_arrays_1_test.dart
+++ b/tests/html/typed_arrays_1_test.dart
@@ -6,6 +6,7 @@ library TypedArrays1Test;
import '../../pkg/unittest/lib/unittest.dart';
import '../../pkg/unittest/lib/html_individual_config.dart';
import 'dart:html';
+import 'dart:typeddata';
main() {
useHtmlIndividualConfiguration();
@@ -23,16 +24,19 @@ main() {
group('arrays', () {
test('createByLengthTest', () {
expect(() {
- var a = new Float32Array(10);
+ var a = new Float32List(10);
expect(a.length, 10);
+ expect(a.lengthInBytes, 40);
expect(a[4], 0);
}, expectation);
});
test('aliasTest', () {
expect(() {
- var a1 = new Uint8Array.fromList([0,0,1,0x45]);
- var a2 = new Float32Array.fromBuffer(a1.buffer);
+ var a1 = new Uint8List.fromList([0,0,1,0x45]);
+ var a2 = new Float32List.view(a1.buffer);
+
+ expect(a1.lengthInBytes, a2.lengthInBytes);
expect(a2.length, 1);
@@ -57,7 +61,7 @@ main() {
if (supportsTypeTest) {
test('typeTests', () {
expect(() {
- var a = new Float32Array(10);
+ var a = new Float32List(10);
expect(a, isList);
expect(a, isnumList);
expect(a, isNot(isStringList));

Powered by Google App Engine
This is Rietveld 408576698