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

Unified Diff: tests/dom/typed_arrays_1_test.dart

Issue 10332013: Reapply support for new Uint8ClampedArray in dart:dom. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
« no previous file with comments | « lib/dom/src/native_FactoryProvidersImplementation.dart ('k') | tests/dom/typed_arrays_2_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/dom/typed_arrays_1_test.dart
diff --git a/tests/dom/typed_arrays_1_test.dart b/tests/dom/typed_arrays_1_test.dart
index c071ff32fc6b9114105a322954c642b25c8105ca..65c8acedd093db69dd391fc8daaffe9cae0c2855 100644
--- a/tests/dom/typed_arrays_1_test.dart
+++ b/tests/dom/typed_arrays_1_test.dart
@@ -33,6 +33,26 @@ main() {
});
+ test('aliasClampedTest', () {
+ var a1 = new Uint8ClampedArray.fromList([0,0,1,0x45]);
+ var a2 = new Float32Array.fromBuffer(a1.buffer);
+
+ Expect.equals(1, a2.length);
+
+ // 0x45010000 = 2048+16
+ Expect.equals(2048 + 16, a2[0]);
+
+ a1[2] = 0;
+ // 0x45000000 = 2048
+ Expect.equals(2048, a2[0]);
+
+ a1[3]--;
+ a1[2] += 128;
+ // 0x44800000 = 1024
+ Expect.equals(1024, a2[0]);
+
+ });
+
test('typeTests', () {
var a = new Float32Array(10);
Expect.isTrue(a is List);
« no previous file with comments | « lib/dom/src/native_FactoryProvidersImplementation.dart ('k') | tests/dom/typed_arrays_2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698