| 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 12bd9f6aae58b8b94972154365b747829e975c69..1c9b4d3fee8ed7341b8316cd988353f058b20815 100644
|
| --- a/tests/html/typed_arrays_1_test.dart
|
| +++ b/tests/html/typed_arrays_1_test.dart
|
| @@ -5,34 +5,37 @@
|
| library TypedArrays1Test;
|
| import '../../pkg/unittest/lib/unittest.dart';
|
| import '../../pkg/unittest/lib/html_individual_config.dart';
|
| -import 'dart:html';
|
| +import 'dart:typeddata';
|
|
|
| main() {
|
| useHtmlIndividualConfiguration();
|
|
|
| var isnumList = predicate((x) => x is List<num>, 'is a List<num>');
|
| var isStringList = predicate((x) => x is List<String>, 'is a List<String>');
|
| - var expectation = ArrayBuffer.supported ? returnsNormally : throws;
|
| + var expectation = ByteBuffer.supported ? returnsNormally : throws;
|
|
|
| group('supported', () {
|
| test('supported', () {
|
| - expect(ArrayBuffer.supported, true);
|
| + expect(ByteBuffer.supported, true);
|
| });
|
| });
|
|
|
| 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 +60,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));
|
|
|