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

Unified Diff: tests/html/typed_arrays_1_test.dart

Issue 12580012: Patchable version of 12929005 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « sdk/lib/web_audio/dart2js/web_audio_dart2js.dart ('k') | tests/html/typed_arrays_2_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
« no previous file with comments | « sdk/lib/web_audio/dart2js/web_audio_dart2js.dart ('k') | tests/html/typed_arrays_2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698