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

Unified Diff: tests/dom/typed_arrays_4_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 | « tests/dom/typed_arrays_2_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/dom/typed_arrays_4_test.dart
diff --git a/tests/dom/typed_arrays_4_test.dart b/tests/dom/typed_arrays_4_test.dart
index 99bec458e2acd597862efeb27bc1ce3a81a503d1..061a2a87f39c2a11c66731f30ff91cd3f69df7b0 100644
--- a/tests/dom/typed_arrays_4_test.dart
+++ b/tests/dom/typed_arrays_4_test.dart
@@ -26,6 +26,21 @@ main() {
Expect.equals(512 + 50, a1.lastIndexOf(50, 768 + 50 - 1));
});
+ test('indexOfClamped_dynamic', () {
+ var a1 = new Uint8ClampedArray(1024);
+ for (int i = 0; i < a1.length; i++) {
+ a1[i] = i;
+ }
+
+ Expect.equals(50, a1.indexOf(50));
+ Expect.equals(50, a1.indexOf(50, 50));
+ Expect.equals(256 + 50, a1.indexOf(50, 51));
+
+ Expect.equals(768 + 50, a1.lastIndexOf(50));
+ Expect.equals(768 + 50, a1.lastIndexOf(50, 768 + 50));
+ Expect.equals(512 + 50, a1.lastIndexOf(50, 768 + 50 - 1));
+ });
+
test('indexOf_typed', () {
Uint8Array a1 = new Uint8Array(1024);
for (int i = 0; i < a1.length; i++) {
@@ -40,4 +55,19 @@ main() {
Expect.equals(768 + 50, a1.lastIndexOf(50, 768 + 50));
Expect.equals(512 + 50, a1.lastIndexOf(50, 768 + 50 - 1));
});
+
+ test('indexOfClamped_typed', () {
+ Uint8ClampedArray a1 = new Uint8ClampedArray(1024);
+ for (int i = 0; i < a1.length; i++) {
+ a1[i] = i;
+ }
+
+ Expect.equals(50, a1.indexOf(50));
+ Expect.equals(50, a1.indexOf(50, 50));
+ Expect.equals(256 + 50, a1.indexOf(50, 51));
+
+ Expect.equals(768 + 50, a1.lastIndexOf(50));
+ Expect.equals(768 + 50, a1.lastIndexOf(50, 768 + 50));
+ Expect.equals(512 + 50, a1.lastIndexOf(50, 768 + 50 - 1));
+ });
}
« no previous file with comments | « tests/dom/typed_arrays_2_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698