[webvtt] Add a test for invalid timestamps

RESOLVED INVALID

Status

()

Core
Audio/Video
RESOLVED INVALID
4 years ago
4 years ago

People

(Reporter: reyre, Unassigned)

Tracking

(Blocks: 1 bug)

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 4 obsolete attachments)

(Reporter)

Description

4 years ago
We just landed a fix that allows us to not add cues for non-fatal errors while parsing. Currently the only non-fatal cue we care about is invalid timestamps. We should probably have a mochitest for this so that we don't accidentally allow this to happen again.
(Reporter)

Updated

4 years ago
Blocks: 629350
Assignee: nobody → caitlin.potter
Where do we want these, content/media/test? dom/media/test?
(Reporter)

Comment 2

4 years ago
Content/media/test would probably be the best since that is where WebVTTLoadListener is and the relevant code.
Created attachment 761517 [details] [diff] [review]
Test that WebVTT cues with bad times are dropped.
Attachment #761517 - Flags: review?(giles)
The commit message is a bit weird, I'm open to suggestions on improving that if need be. Otherwise it's all passing here.
Created attachment 761522 [details] [diff] [review]
Test that WebVTT cues with bad times are dropped. V2

Just some formatting fixups
Attachment #761517 - Attachment is obsolete: true
Attachment #761517 - Flags: review?(giles)
Attachment #761522 - Flags: review?(giles)
Depends on: 882535
Created attachment 761847 [details] [diff] [review]
Test that WebVTT cues with bad times are dropped. V3

Like V2, but now relies on HTMLTrackElement's readyState to determine if the track is loaded and useable or not.

This test does not rely on flaky arbitrary timed timeouts, and has a way of knowing when to stop retrying, so it should work consistently, hopefully.
Attachment #761522 - Attachment is obsolete: true
Attachment #761522 - Flags: review?(giles)
Attachment #761847 - Flags: review?(giles)
Attachment #761847 - Flags: feedback?(rick.eyre)
(Reporter)

Comment 7

4 years ago
Comment on attachment 761847 [details] [diff] [review]
Test that WebVTT cues with bad times are dropped. V3

Review of attachment 761847 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me with nits. Great work.

::: content/media/test/Makefile.in
@@ +383,5 @@
>  		test_can_play_type_no_wave.html \
>  		$(NULL)
>  endif
>  
> +# Bug 882131

I think you can move these up to the main lists. The first MOCHITEST_FILES list for the .html and the #sample files for the .vtt file. Check with Ralph though if this is needed.

::: content/media/test/test_bug882131.html
@@ +13,5 @@
> +  /** Test for Bug 882131 **/
> +  function test_bug882131() {
> +    var video = document.createElement("video");
> +    video.src = "seek.webm";
> +    

White space here.

@@ +53,5 @@
> +
> +  </script>
> +</head>
> +<body>
> +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=882131">Mozilla Bug 882131</a>

The style is usually to put this section, including the content div and pre, etc, above your script.
Attachment #761847 - Flags: feedback?(rick.eyre) → feedback+
This is the structure output from gen_template.pl, so I think I'm going to leave that.

Will see what Ralph thinks about the makefile
Created attachment 762003 [details] [diff] [review]
Test that WebVTT cues with bad times are dropped. V4

Removed trailing whitespace from test_bug882131.html
Attachment #761847 - Attachment is obsolete: true
Attachment #761847 - Flags: review?(giles)
Attachment #762003 - Flags: review?(giles)
Attachment #762003 - Flags: feedback+
(Reporter)

Updated

4 years ago
Depends on: 882817
(Reporter)

Comment 10

4 years ago
https://tbpl.mozilla.org/?tree=Try&rev=9f09df497708

Changesets for tests don't show up in the try push as I pushed them earlier today, but you can see the tests were run correctly in the log file.
I don't actually see test_881232.html in the full logs
Nevermind, ignore that, it's 6am it's allowed.
Nevermind, ignore that, it's 6am it's allowed.
Comment on attachment 762003 [details] [diff] [review]
Test that WebVTT cues with bad times are dropped. V4

Review of attachment 762003 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good, thanks.

I agree with Rick that you might as well add the html and vtt files to the respective combined MOCHITEST_FILE lists. It makes the file slightly shorter and easier to search. Not hugely important though, so r=me either way.
Attachment #762003 - Flags: review?(giles) → review+
(Reporter)

Comment 15

4 years ago
I did a try for this the other day and it's suffering from the same android problem:

https://tbpl.mozilla.org/?tree=Try&rev=5d6c005645fc
Goddamned Android (╯°□°)╯︵ ┻━┻ fails at everything.
Created attachment 764358 [details] [diff] [review]
Test that WebVTT cues with bad times are dropped. V5

Added files at the first chunk of MOCHITEST_FILES in content/media/test/Makefile.in
Attachment #762003 - Attachment is obsolete: true
Attachment #764358 - Flags: review+
(Reporter)

Updated

4 years ago
Depends on: 884884
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → WONTFIX
Delete your patch if you don't want it to land, but this bug is still valid.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Assignee: caitlin.potter → nobody
(Reporter)

Comment 19

4 years ago
The code for this has been removed. The parser that will be landed doesn't work with error messages at all. Closing as invalid.
Status: REOPENED → RESOLVED
Last Resolved: 4 years ago4 years ago
Resolution: --- → INVALID
You're an idiot, Rick. This bug had nothing to do with reporting error messages, it is about dropping cues.
(Reporter)

Comment 21

4 years ago
What I mean is that the new parser does not return cues that we may want to discard due to an error. The new parser just ignores anything that spec tells us to ignore. Therefore, we do not need to have this code anymore.
You're an idiot, Rick. "The new parser just ignores anything that the spec tells us to ignore. Therefore, we do not need tests to ensure that we are ignoring things"

That is exactly the way the C parser worked -- The test is to verify that it is working like that.

But the three of you are so mentally incompetent that it's not even worth looking at, I'm only bringing this up because I'm still getting emails about this ****. Honestly, pull your heads out of your asses. Tests are implemented for a reason, to ensure that you don't **** up.
And don't think I'm talking **** to you, I'm doing you a favour. The only excuse for not having tests here, would be if the tests are already implemented somewhere else, which is being monitored regularly. And honestly that's not even a very good excuse, especially considering that these tests predate the other **** entirely. But it doesn't matter whether it's these tests, or other ones, the bottom line is that if you don't have the tests, and you aren't running and monitoring them, you're a **** idiot and should remove yourself from computers and get a job as a busboy or something, because software is not your thing. And when your rationale for closing something as invalid is as **** as "well our parser doesn't report errors", you demonstrate a fundamental misunderstanding of what the **** the bug and tests are even about, and that you don't have any **** concept of behaviour driven development, which, considering the new implementation is javascript, IS **** UNACCEPTABLE, ENTIRELY. Like, you simply cannot **** write a javascript library and NOT do that. That is **** idiocy.
You need to log in before you can comment on or make changes to this bug.