Index: LayoutTests/fast/canvas/webgl/array-unit-tests.html |
=================================================================== |
--- LayoutTests/fast/canvas/webgl/array-unit-tests.html (revision 139639) |
+++ LayoutTests/fast/canvas/webgl/array-unit-tests.html (working copy) |
@@ -544,6 +544,16 @@ |
} |
} |
+function testConstructionWithExceptionThrowingObject(type, name) { |
+ var o = {}; |
+ Object.defineProperty(o, "length", { get: function() { throw "bail;" }}); |
+ try { |
+ var array = new type(o); |
+ } catch (e) { |
+ } |
+ testPassed("Construction of " + name + " with exception-throwing array-like object didn't crash unexpectedly"); |
+} |
+ |
function shouldThrowIndexSizeErr(func, text) { |
var errorText = text + " should throw an exception"; |
try { |
@@ -1063,6 +1073,7 @@ |
testCase.testValues, |
testCase.expectedValues); |
testConstructionWithNullBuffer(type, name); |
+ testConstructionWithExceptionThrowingObject(type, name); |
testConstructionWithOutOfRangeValues(type, name); |
testConstructionWithNegativeOutOfRangeValues(type, name); |
testConstructionWithUnalignedOffset(type, name, testCase.elementSizeInBytes); |