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; |
} |