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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-lineDash-input-sequence.html

Issue 2810843002: bindings: Make the sequence conversion code more complaint with WebIDL. (Closed)
Patch Set: Adjust even more tests Created 3 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: third_party/WebKit/LayoutTests/fast/canvas/canvas-lineDash-input-sequence.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-lineDash-input-sequence.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-lineDash-input-sequence.html
index 1cbcb5f0e1170ca5a29f86868903ec51f2167c6e..e854b3084263875200ac6ee10b47837d7a514f7c 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-lineDash-input-sequence.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-lineDash-input-sequence.html
@@ -13,17 +13,30 @@ test(function(t) {
var arrayValues = [5, 15, 25];
+ function createIterableObject() {
+ return {
+ [Symbol.iterator]() {
+ var i = 0;
+ return {
+ next() {
+ if (i >= arrayValues.length)
+ return { done: true };
+ return { done: false, value: arrayValues[i++] };
+ }
+ }
+ }
+ }
+ }
+
function createTestArray(arrayType) {
var array;
if (arrayType == Object) {
- // Test a "sequence" (Object with length property).
- array = {length: arrayValues.length};
+ array = createIterableObject();
} else {
array = new arrayType(arrayValues.length);
+ for (var i = 0; i < arrayValues.length; ++i)
+ array[i] = arrayValues[i];
}
-
- for (var i = 0; i < arrayValues.length; ++i)
- array[i] = arrayValues[i]
return array;
}

Powered by Google App Engine
This is Rietveld 408576698