OLD | NEW |
| (Empty) |
1 Tests TextTrackRegionList 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 ** The regions attribute should be an empty TextTrackRegionList ** | |
9 EXPECTED (regions != null == 'true') OK | |
10 EXPECTED (regions.length == '0') OK | |
11 | |
12 ** The default value of the track attribute of the region is null** | |
13 EXPECTED (region.track == 'null') OK | |
14 | |
15 ** The addRegion() method properly updates the TextTrackRegionList object ** | |
16 EXPECTED (regions.length == '1') OK | |
17 EXPECTED (regions[0] == region == 'true') OK | |
18 EXPECTED (regions[0].track == testTrack.track == 'true') OK | |
19 | |
20 ** The track attribute should correctly reflect the track to which the region wa
s added to** | |
21 EXPECTED (region.track == testTrack.track == 'true') OK | |
22 | |
23 ** Adding a region with an existing id should update the existing region ** | |
24 EXPECTED (regions[0].viewportAnchorX == '59') OK | |
25 EXPECTED (regions[0].viewportAnchorY == '68') OK | |
26 EXPECTED (regions[0].regionAnchorX == '20') OK | |
27 EXPECTED (regions[0].regionAnchorY == '30') OK | |
28 EXPECTED (regions[0].height == '5') OK | |
29 EXPECTED (regions[0].width == '87') OK | |
30 EXPECTED (regions[0].scroll == 'up') OK | |
31 EXPECTED (regions[0] != updatedRegion == 'true') OK | |
32 | |
33 ** Add the region back and check if removeRegion() removes it properly ** | |
34 EXPECTED (regions.length == '1') OK | |
35 EXPECTED (regions.length == '0') OK | |
36 | |
37 ** In case the region is not found, NotFoundError should be thrown ** | |
38 NotFoundError: An attempt was made to reference a Node in a context where it doe
s not exist. | |
39 | |
40 END OF TEST | |
41 | |
OLD | NEW |