OLD | NEW |
---|---|
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <meta charset="utf-8"> | 4 <meta charset="utf-8"> |
5 <link rel="stylesheet" href="../../resources/js-test-style.css"/> | 5 <link rel="stylesheet" href="../../resources/js-test-style.css"/> |
6 <script src="../../js/resources/js-test-pre.js"></script> | 6 <script src="../../js/resources/js-test-pre.js"></script> |
7 <script src="resources/webgl-test.js"></script> | 7 <script src="resources/webgl-test.js"></script> |
8 <script src="resources/typed-array-test-cases.js"></script> | 8 <script src="resources/typed-array-test-cases.js"></script> |
9 </head> | 9 </head> |
10 <body> | 10 <body> |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 | 116 |
117 function testInheritanceHierarchy() { | 117 function testInheritanceHierarchy() { |
118 debug('test inheritance hierarchy of typed array views'); | 118 debug('test inheritance hierarchy of typed array views'); |
119 | 119 |
120 try { | 120 try { |
121 var foo = ArrayBufferView; | 121 var foo = ArrayBufferView; |
122 testFailed('ArrayBufferView has [NoInterfaceObject] extended attribute and s hould not be defined'); | 122 testFailed('ArrayBufferView has [NoInterfaceObject] extended attribute and s hould not be defined'); |
123 } catch (e) { | 123 } catch (e) { |
124 testPassed('ArrayBufferView has [NoInterfaceObject] extended attribute and w as (correctly) not defined'); | 124 testPassed('ArrayBufferView has [NoInterfaceObject] extended attribute and w as (correctly) not defined'); |
125 } | 125 } |
126 | |
127 // There is currently only one kind of view that inherits from another | |
128 shouldBe('new Uint8ClampedArray(1) instanceof Uint8Array', 'true'); | |
Ken Russell (switch to Gerrit)
2013/07/17 03:01:35
This is problematic and needs to be resolved. The
| |
129 } | 126 } |
130 | 127 |
131 // | 128 // |
132 // Tests for unsigned array variants | 129 // Tests for unsigned array variants |
133 // | 130 // |
134 | 131 |
135 function testSetAndGet10To1(type, name) { | 132 function testSetAndGet10To1(type, name) { |
136 running('test ' + name + ' SetAndGet10To1'); | 133 running('test ' + name + ' SetAndGet10To1'); |
137 try { | 134 try { |
138 var array = new type(10); | 135 var array = new type(10); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
337 array = new type([2, 3]); | 334 array = new type([2, 3]); |
338 shouldBeUndefined("array[2]"); | 335 shouldBeUndefined("array[2]"); |
339 shouldBeUndefined("array[-1]"); | 336 shouldBeUndefined("array[-1]"); |
340 shouldBeUndefined("array[0x20000000]"); | 337 shouldBeUndefined("array[0x20000000]"); |
341 } | 338 } |
342 | 339 |
343 function testOffsetsAndSizes(type, name, elementSizeInBytes) { | 340 function testOffsetsAndSizes(type, name, elementSizeInBytes) { |
344 running('test ' + name + ' OffsetsAndSizes'); | 341 running('test ' + name + ' OffsetsAndSizes'); |
345 try { | 342 try { |
346 var len = 10; | 343 var len = 10; |
347 assertEq('type.BYTES_PER_ELEMENT', elementSizeInBytes, type.BYTES_PER_ELEMEN T); | |
348 var array = new type(len); | 344 var array = new type(len); |
345 assertEq('array.BYTES_PER_ELEMENT', elementSizeInBytes, array.BYTES_PER_ELEM ENT); | |
Ken Russell (switch to Gerrit)
2013/07/17 03:01:35
This is a major compatibility problem. BYTES_PER_E
| |
349 assert('array.buffer', array.buffer); | 346 assert('array.buffer', array.buffer); |
350 assertEq('array.byteOffset', 0, array.byteOffset); | 347 assertEq('array.byteOffset', 0, array.byteOffset); |
351 assertEq('array.length', len, array.length); | 348 assertEq('array.length', len, array.length); |
352 assertEq('array.byteLength', len * elementSizeInBytes, array.byteLength); | 349 assertEq('array.byteLength', len * elementSizeInBytes, array.byteLength); |
353 array = new type(array.buffer, elementSizeInBytes, len - 1); | 350 array = new type(array.buffer, elementSizeInBytes, len - 1); |
354 assert('array.buffer', array.buffer); | 351 assert('array.buffer', array.buffer); |
355 assertEq('array.byteOffset', elementSizeInBytes, array.byteOffset); | 352 assertEq('array.byteOffset', elementSizeInBytes, array.byteOffset); |
356 assertEq('array.length', len - 1, array.length); | 353 assertEq('array.length', len - 1, array.length); |
357 assertEq('array.byteLength', (len - 1) * elementSizeInBytes, array.byteLengt h); | 354 assertEq('array.byteLength', (len - 1) * elementSizeInBytes, array.byteLengt h); |
358 pass(); | 355 pass(); |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
996 testConstructionBoundaryConditions(type, | 993 testConstructionBoundaryConditions(type, |
997 name, | 994 name, |
998 testCase.testValues, | 995 testCase.testValues, |
999 testCase.expectedValues); | 996 testCase.expectedValues); |
1000 testConstructionWithNullBuffer(type, name); | 997 testConstructionWithNullBuffer(type, name); |
1001 testConstructionWithExceptionThrowingObject(type, name); | 998 testConstructionWithExceptionThrowingObject(type, name); |
1002 testConstructionWithOutOfRangeValues(type, name); | 999 testConstructionWithOutOfRangeValues(type, name); |
1003 testConstructionWithNegativeOutOfRangeValues(type, name); | 1000 testConstructionWithNegativeOutOfRangeValues(type, name); |
1004 testConstructionWithUnalignedOffset(type, name, testCase.elementSizeInBytes) ; | 1001 testConstructionWithUnalignedOffset(type, name, testCase.elementSizeInBytes) ; |
1005 testConstructionWithUnalignedLength(type, name, testCase.elementSizeInBytes) ; | 1002 testConstructionWithUnalignedLength(type, name, testCase.elementSizeInBytes) ; |
1006 testConstructionOfHugeArray(type, name, testCase.elementSizeInBytes); | |
1007 testConstructionWithBothArrayBufferAndLength(type, name, testCase.elementSiz eInBytes); | 1003 testConstructionWithBothArrayBufferAndLength(type, name, testCase.elementSiz eInBytes); |
1008 testConstructionWithSubPortionOfArrayBuffer(type, name, testCase.elementSize InBytes); | 1004 testConstructionWithSubPortionOfArrayBuffer(type, name, testCase.elementSize InBytes); |
1009 testSubarrayWithOutOfRangeValues(type, name, testCase.elementSizeInBytes); | 1005 testSubarrayWithOutOfRangeValues(type, name, testCase.elementSizeInBytes); |
1010 testSubarrayWithDefaultValues(type, name, testCase.elementSizeInBytes); | 1006 testSubarrayWithDefaultValues(type, name, testCase.elementSizeInBytes); |
1011 testSettingFromArrayWithOutOfRangeOffset(type, name); | 1007 testSettingFromArrayWithOutOfRangeOffset(type, name); |
1012 testSettingFromTypedArrayWithOutOfRangeOffset(type, name); | 1008 testSettingFromTypedArrayWithOutOfRangeOffset(type, name); |
1013 testSettingFromArrayWithNegativeOffset(type, name); | 1009 testSettingFromArrayWithNegativeOffset(type, name); |
1014 testSettingFromTypedArrayWithNegativeOffset(type, name); | 1010 testSettingFromTypedArrayWithNegativeOffset(type, name); |
1015 testSettingFromArrayWithMinusZeroOffset(type, name); | 1011 testSettingFromArrayWithMinusZeroOffset(type, name); |
1016 testSettingFromTypedArrayWithMinusZeroOffset(type, name); | 1012 testSettingFromTypedArrayWithMinusZeroOffset(type, name); |
(...skipping 10 matching lines...) Expand all Loading... | |
1027 } | 1023 } |
1028 | 1024 |
1029 runTests(); | 1025 runTests(); |
1030 var successfullyParsed = true; | 1026 var successfullyParsed = true; |
1031 | 1027 |
1032 </script> | 1028 </script> |
1033 <script src="../../js/resources/js-test-post.js"></script> | 1029 <script src="../../js/resources/js-test-post.js"></script> |
1034 | 1030 |
1035 </body> | 1031 </body> |
1036 </html> | 1032 </html> |
OLD | NEW |