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

Unified Diff: tests/dom/typed_arrays_1_test.dart

Issue 10252023: Supper Uint8Clamped in manually written factories. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: + tests 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..b683337a8046dde8f55754f22d7cade1fa977a76 100644
--- a/tests/dom/typed_arrays_1_test.dart
+++ b/tests/dom/typed_arrays_1_test.dart
@@ -33,6 +33,26 @@ main() {
});
+ test('aliasiClampedTest', () {
podivilov 2012/05/02 14:54:37 It would make more sense to update html versions o
Anton Muhin 2012/05/02 14:56:32 I hope they'd be merged. In any event, I am not s
+ 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