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

Unified Diff: tests/html/typed_arrays_1_test.dart

Issue 12929005: dart:typeddata for dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revert status change Created 7 years, 9 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 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]);
Anton Muhin 2013/03/19 12:31:24 There is no such beast. But I think we should hav
Mads Ager (google) 2013/03/19 12:40:50 On List in core there is a from(Iterable other) co
blois 2013/03/19 17:26:11 Agree- I've seen unrelated bugs come through where
+ 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));

Powered by Google App Engine
This is Rietveld 408576698