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

Unified Diff: tests/html/typed_arrays_3_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_3_test.dart
diff --git a/tests/html/typed_arrays_3_test.dart b/tests/html/typed_arrays_3_test.dart
index a11287ac04258a200820e1132e2586fc2ebb22ec..16537cb53fbcddf80b1b9a1c81799c360892c8e4 100644
--- a/tests/html/typed_arrays_3_test.dart
+++ b/tests/html/typed_arrays_3_test.dart
@@ -6,6 +6,7 @@ library TypedArrays3Test;
import '../../pkg/unittest/lib/unittest.dart';
import '../../pkg/unittest/lib/html_config.dart';
import 'dart:html';
+import 'dart:typeddata';
main() {
useHtmlConfiguration();
@@ -16,29 +17,29 @@ main() {
}
test('setElementsTest_dynamic', () {
- var a1 = new Int8Array(1024);
+ var a1 = new Int8List(1024);
- a1.setElements([0x50,0x60,0x70], 4);
+ a1.setRange(4, 7, [0x50,0x60,0x70]);
- var a2 = new Uint32Array.fromBuffer(a1.buffer);
+ var a2 = new Uint32List.view(a1.buffer);
expect(a2[0], 0x00000000);
expect(a2[1], 0x00706050);
- a2.setElements([0x01020304], 2);
+ a2.setRange(2, 3, [0x01020304]);
expect(a1[8], 0x04);
expect(a1[11], 0x01);
});
test('setElementsTest_typed', () {
- Int8Array a1 = new Int8Array(1024);
+ Int8List a1 = new Int8List(1024);
- a1.setElements([0x50,0x60,0x70], 4);
+ a1.setRange(4, 7, [0x50,0x60,0x70]);
- Uint32Array a2 = new Uint32Array.fromBuffer(a1.buffer);
+ Uint32List a2 = new Uint32List.view(a1.buffer);
expect(a2[0], 0x00000000);
expect(a2[1], 0x00706050);
- a2.setElements([0x01020304], 2);
+ a2.setRange(2, 3, [0x01020304]);
expect(a1[8], 0x04);
expect(a1[11], 0x01);
});

Powered by Google App Engine
This is Rietveld 408576698