OLD | NEW |
| (Empty) |
1 Tests VTTRegionList functionality: length, operator[], and getRegionById() | |
2 | |
3 | |
4 ** Implicit mode disabled and the regions attribute is null ** | |
5 EXPECTED (testTrack.track.mode == 'disabled') OK | |
6 EXPECTED (testTrack.track.regions == 'null') OK | |
7 | |
8 ** Test instanceof VTTRegionList ** | |
9 EXPECTED (regions instanceof VTTRegionList == 'true') OK | |
10 | |
11 ** The regions attribute should be an empty VTTRegionList ** | |
12 EXPECTED (regions != null == 'true') OK | |
13 EXPECTED (regions.length == '0') OK | |
14 | |
15 ** The default value of the track attribute of the region is null** | |
16 EXPECTED (region.track == 'null') OK | |
17 | |
18 ** The addRegion() method properly updates the VTTRegionList object ** | |
19 EXPECTED (regions.length == '1') OK | |
20 EXPECTED (regions[0] == region == 'true') OK | |
21 EXPECTED (regions[0].track == testTrack.track == 'true') OK | |
22 | |
23 ** The track attribute should correctly reflect the track to which the region wa
s added to** | |
24 EXPECTED (region.track == testTrack.track == 'true') OK | |
25 | |
26 ** Adding a region with an existing id should update the existing region ** | |
27 EXPECTED (regions[0].viewportAnchorX == '59') OK | |
28 EXPECTED (regions[0].viewportAnchorY == '68') OK | |
29 EXPECTED (regions[0].regionAnchorX == '20') OK | |
30 EXPECTED (regions[0].regionAnchorY == '30') OK | |
31 EXPECTED (regions[0].height == '5') OK | |
32 EXPECTED (regions[0].width == '87') OK | |
33 EXPECTED (regions[0].scroll == 'up') OK | |
34 EXPECTED (regions[0] != updatedRegion == 'true') OK | |
35 | |
36 ** Add the region back and check if removeRegion() removes it properly ** | |
37 EXPECTED (regions.length == '1') OK | |
38 EXPECTED (regions.length == '0') OK | |
39 | |
40 ** In case the region is not found, NotFoundError should be thrown ** | |
41 NotFoundError: Failed to execute 'removeRegion' on 'TextTrack': The specified re
gion is not listed in the TextTrack's list of regions. | |
42 | |
43 END OF TEST | |
44 | |
OLD | NEW |