| OLD | NEW |
| (Empty) |
| 1 Tests the constructor and mutation of VTTRegion. | |
| 2 | |
| 3 ** Test instanceof VTTRegion. ** | |
| 4 EXPECTED (region instanceof VTTRegion == 'true') OK | |
| 5 ** Test the default indexs of a region. ** | |
| 6 EXPECTED (region.track == 'null') OK | |
| 7 EXPECTED (region.scroll == '') OK | |
| 8 EXPECTED (region.viewportAnchorX == '0') OK | |
| 9 EXPECTED (region.viewportAnchorY == '100') OK | |
| 10 EXPECTED (region.regionAnchorX == '0') OK | |
| 11 EXPECTED (region.regionAnchorY == '100') OK | |
| 12 EXPECTED (region.height == '3') OK | |
| 13 EXPECTED (region.width == '100') OK | |
| 14 | |
| 15 ** Test that incorrect mutation keeps previous valid values. ** | |
| 16 RUN(region.scroll = 'invalid-scroll-value') | |
| 17 SyntaxError: Failed to set the 'scroll' property on 'VTTRegion': The value provi
ded ('invalid-scroll-value') is invalid. The 'scroll' property must be either th
e empty string, or 'up'. | |
| 18 EXPECTED (region.scroll == '') OK | |
| 19 | |
| 20 Invalid percentage value: -1 | |
| 21 RUN(region.viewportAnchorX = invalidPercentageValues[index]) | |
| 22 IndexSizeError: Failed to set the 'viewportAnchorX' property on 'VTTRegion': The
value provided (-1) is outside the range [0, 100]. | |
| 23 EXPECTED (region.viewportAnchorX == '0') OK | |
| 24 RUN(region.viewportAnchorY = invalidPercentageValues[index]) | |
| 25 IndexSizeError: Failed to set the 'viewportAnchorY' property on 'VTTRegion': The
value provided (-1) is outside the range [0, 100]. | |
| 26 EXPECTED (region.viewportAnchorY == '100') OK | |
| 27 RUN(region.regionAnchorX = invalidPercentageValues[index]) | |
| 28 IndexSizeError: Failed to set the 'regionAnchorX' property on 'VTTRegion': The v
alue provided (-1) is outside the range [0, 100]. | |
| 29 EXPECTED (region.regionAnchorX == '0') OK | |
| 30 RUN(region.regionAnchorY = invalidPercentageValues[index]) | |
| 31 IndexSizeError: Failed to set the 'regionAnchorY' property on 'VTTRegion': The v
alue provided (-1) is outside the range [0, 100]. | |
| 32 EXPECTED (region.regionAnchorY == '100') OK | |
| 33 RUN(region.width = invalidPercentageValues[index]) | |
| 34 IndexSizeError: Failed to set the 'width' property on 'VTTRegion': The value pro
vided (-1) is outside the range [0, 100]. | |
| 35 EXPECTED (region.width == '100') OK | |
| 36 | |
| 37 Invalid percentage value: 101 | |
| 38 RUN(region.viewportAnchorX = invalidPercentageValues[index]) | |
| 39 IndexSizeError: Failed to set the 'viewportAnchorX' property on 'VTTRegion': The
value provided (101) is outside the range [0, 100]. | |
| 40 EXPECTED (region.viewportAnchorX == '0') OK | |
| 41 RUN(region.viewportAnchorY = invalidPercentageValues[index]) | |
| 42 IndexSizeError: Failed to set the 'viewportAnchorY' property on 'VTTRegion': The
value provided (101) is outside the range [0, 100]. | |
| 43 EXPECTED (region.viewportAnchorY == '100') OK | |
| 44 RUN(region.regionAnchorX = invalidPercentageValues[index]) | |
| 45 IndexSizeError: Failed to set the 'regionAnchorX' property on 'VTTRegion': The v
alue provided (101) is outside the range [0, 100]. | |
| 46 EXPECTED (region.regionAnchorX == '0') OK | |
| 47 RUN(region.regionAnchorY = invalidPercentageValues[index]) | |
| 48 IndexSizeError: Failed to set the 'regionAnchorY' property on 'VTTRegion': The v
alue provided (101) is outside the range [0, 100]. | |
| 49 EXPECTED (region.regionAnchorY == '100') OK | |
| 50 RUN(region.width = invalidPercentageValues[index]) | |
| 51 IndexSizeError: Failed to set the 'width' property on 'VTTRegion': The value pro
vided (101) is outside the range [0, 100]. | |
| 52 EXPECTED (region.width == '100') OK | |
| 53 | |
| 54 Invalid percentage value: -Infinity | |
| 55 RUN(region.viewportAnchorX = invalidPercentageValues[index]) | |
| 56 TypeError: Failed to set the 'viewportAnchorX' property on 'VTTRegion': The prov
ided double value is non-finite. | |
| 57 EXPECTED (region.viewportAnchorX == '0') OK | |
| 58 RUN(region.viewportAnchorY = invalidPercentageValues[index]) | |
| 59 TypeError: Failed to set the 'viewportAnchorY' property on 'VTTRegion': The prov
ided double value is non-finite. | |
| 60 EXPECTED (region.viewportAnchorY == '100') OK | |
| 61 RUN(region.regionAnchorX = invalidPercentageValues[index]) | |
| 62 TypeError: Failed to set the 'regionAnchorX' property on 'VTTRegion': The provid
ed double value is non-finite. | |
| 63 EXPECTED (region.regionAnchorX == '0') OK | |
| 64 RUN(region.regionAnchorY = invalidPercentageValues[index]) | |
| 65 TypeError: Failed to set the 'regionAnchorY' property on 'VTTRegion': The provid
ed double value is non-finite. | |
| 66 EXPECTED (region.regionAnchorY == '100') OK | |
| 67 RUN(region.width = invalidPercentageValues[index]) | |
| 68 TypeError: Failed to set the 'width' property on 'VTTRegion': The provided doubl
e value is non-finite. | |
| 69 EXPECTED (region.width == '100') OK | |
| 70 | |
| 71 Invalid percentage value: Infinity | |
| 72 RUN(region.viewportAnchorX = invalidPercentageValues[index]) | |
| 73 TypeError: Failed to set the 'viewportAnchorX' property on 'VTTRegion': The prov
ided double value is non-finite. | |
| 74 EXPECTED (region.viewportAnchorX == '0') OK | |
| 75 RUN(region.viewportAnchorY = invalidPercentageValues[index]) | |
| 76 TypeError: Failed to set the 'viewportAnchorY' property on 'VTTRegion': The prov
ided double value is non-finite. | |
| 77 EXPECTED (region.viewportAnchorY == '100') OK | |
| 78 RUN(region.regionAnchorX = invalidPercentageValues[index]) | |
| 79 TypeError: Failed to set the 'regionAnchorX' property on 'VTTRegion': The provid
ed double value is non-finite. | |
| 80 EXPECTED (region.regionAnchorX == '0') OK | |
| 81 RUN(region.regionAnchorY = invalidPercentageValues[index]) | |
| 82 TypeError: Failed to set the 'regionAnchorY' property on 'VTTRegion': The provid
ed double value is non-finite. | |
| 83 EXPECTED (region.regionAnchorY == '100') OK | |
| 84 RUN(region.width = invalidPercentageValues[index]) | |
| 85 TypeError: Failed to set the 'width' property on 'VTTRegion': The provided doubl
e value is non-finite. | |
| 86 EXPECTED (region.width == '100') OK | |
| 87 | |
| 88 Invalid percentage value: NaN | |
| 89 RUN(region.viewportAnchorX = invalidPercentageValues[index]) | |
| 90 TypeError: Failed to set the 'viewportAnchorX' property on 'VTTRegion': The prov
ided double value is non-finite. | |
| 91 EXPECTED (region.viewportAnchorX == '0') OK | |
| 92 RUN(region.viewportAnchorY = invalidPercentageValues[index]) | |
| 93 TypeError: Failed to set the 'viewportAnchorY' property on 'VTTRegion': The prov
ided double value is non-finite. | |
| 94 EXPECTED (region.viewportAnchorY == '100') OK | |
| 95 RUN(region.regionAnchorX = invalidPercentageValues[index]) | |
| 96 TypeError: Failed to set the 'regionAnchorX' property on 'VTTRegion': The provid
ed double value is non-finite. | |
| 97 EXPECTED (region.regionAnchorX == '0') OK | |
| 98 RUN(region.regionAnchorY = invalidPercentageValues[index]) | |
| 99 TypeError: Failed to set the 'regionAnchorY' property on 'VTTRegion': The provid
ed double value is non-finite. | |
| 100 EXPECTED (region.regionAnchorY == '100') OK | |
| 101 RUN(region.width = invalidPercentageValues[index]) | |
| 102 TypeError: Failed to set the 'width' property on 'VTTRegion': The provided doubl
e value is non-finite. | |
| 103 EXPECTED (region.width == '100') OK | |
| 104 RUN(region.height = -1) | |
| 105 IndexSizeError: Failed to set the 'height' property on 'VTTRegion': The height p
rovided (-1) is negative. | |
| 106 EXPECTED (region.height == '3') OK | |
| 107 | |
| 108 ** Test that proper mutation keeps assigned value. ** | |
| 109 RUN(region.height = 130) | |
| 110 EXPECTED (region.height == '130') OK | |
| 111 RUN(region.viewportAnchorX = 64) | |
| 112 EXPECTED (region.viewportAnchorX == '64') OK | |
| 113 RUN(region.viewportAnchorY = 32) | |
| 114 EXPECTED (region.viewportAnchorY == '32') OK | |
| 115 RUN(region.regionAnchorX = 16) | |
| 116 EXPECTED (region.regionAnchorX == '16') OK | |
| 117 RUN(region.regionAnchorY = 8) | |
| 118 EXPECTED (region.regionAnchorY == '8') OK | |
| 119 RUN(region.width = 42) | |
| 120 EXPECTED (region.width == '42') OK | |
| 121 END OF TEST | |
| 122 | |
| OLD | NEW |