[Gecko Bug 1548731] part3 : modify wpt 'track-mode.html'. #16879
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch does two changes in order to test the correct behavior.
(1) Not to use time out function
Waiting for 0.4s by using timeout function doesn't mean the code will exactly be executed after 0.4s.
If we would like to specify the time when we would like to change track's mode, we should listen for video's
timeupdate
to get the correct result.(2) Modify ending condition
As this test is going to turn the track's mode to
showing/hidden
after video plays after 0.4s, the second and the third cue would be showed correctly.The second cue is from 0.3 to 0.7, so when we changed track mode in 0.4s, the second cue would be regard as an active cue, and we would dispatched
enter
event on it. When the cue is going to become inactive, the eventexit
would be dispatched.Therefore, there would be total 4 times of the accumulation of
enter
andexit
events, which meansoncuechange
would also be dispatched 4 times.Differential Revision: https://phabricator.services.mozilla.com/D30141
bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1548731
gecko-commit: 304294b29dae2db6e398ed5693d5a65821812c0d
gecko-integration-branch: central
gecko-reviewers: smaug