Bug 1283803 - part5 : fix the fail test. draft
authorAlastor Wu <alwu@mozilla.com>
Tue, 19 Jul 2016 17:07:41 +0800
changeset 389454 db604e5efb3f38f37ecd5dd6f62b7674f0089c88
parent 389453 a3d0814f0b4580b47991bd62610d38d2465b19eb
child 389462 584292329a46b2686a30c0ef8b37523bf3815bdc
push id23406
push useralwu@mozilla.com
push dateTue, 19 Jul 2016 09:08:14 +0000
bugs1283803
milestone50.0a1
Bug 1283803 - part5 : fix the fail test. MozReview-Commit-ID: LgjDpvW2rQj
dom/media/test/mochitest.ini
dom/media/webvtt/vtt.jsm
--- 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;