Bug 1283803 - part5 : fix the fail test.
MozReview-Commit-ID: LgjDpvW2rQj
--- a/dom/media/test/mochitest.ini
+++ b/dom/media/test/mochitest.ini
@@ -604,16 +604,17 @@ skip-if = (os == 'mac' && os_version ==
[test_bug686942.html]
[test_bug726904.html]
[test_bug874897.html]
[test_bug879717.html]
tags=capturestream
skip-if = os == 'win' && !debug # bug 1140675
[test_bug883173.html]
[test_bug895091.html]
+tags=webvtt
[test_bug895305.html]
[test_bug919265.html]
[test_bug957847.html]
[test_bug1018933.html]
[test_bug1113600.html]
tags=capturestream
[test_bug1242338.html]
[test_bug1242594.html]
--- a/dom/media/webvtt/vtt.jsm
+++ b/dom/media/webvtt/vtt.jsm
@@ -1431,16 +1431,21 @@ this.EXPORTED_SYMBOLS = ["WebVTT"];
var line;
if (self.state === "HEADER") {
line = parseHeader();
}
while (self.buffer) {
if (!line) {
+ // Since the data receiving is async, we need to wait until the
+ // buffer gets the full line.
+ if (!/\r\n|\n/.test(self.buffer)) {
+ return this;
+ }
line = collectNextLine();
}
switch (self.state) {
case "ID":
// Ignore NOTE and line terminator
if (/^NOTE($|[ \t])/.test(line) || !line) {
break;