Backed out changeset 813d1273fa61 (bug 1298436) for bc4 crashes a=backout
authorWes Kocher <wkocher@mozilla.com>
Fri, 02 Sep 2016 13:07:34 -0700
changeset 342576 f21c8cd0a959e1b54566fb800bf8b3bb765cb503
parent 342575 3d6fce4d6f7baa779bf666162247520aaea7b151
child 342577 f38976dc24a4f8a050f3d39909a2abaef15682e4
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1298436
milestone49.0
backs out813d1273fa611d5e2a0675ddae432662fae33e35
Backed out changeset 813d1273fa61 (bug 1298436) for bc4 crashes a=backout
toolkit/components/narrate/Narrator.jsm
toolkit/components/narrate/test/browser_narrate.js
--- a/toolkit/components/narrate/Narrator.jsm
+++ b/toolkit/components/narrate/Narrator.jsm
@@ -139,18 +139,18 @@ Narrator.prototype = {
     win.dispatchEvent(new win.CustomEvent(eventType,
       { detail: Cu.cloneInto(detail, win.document) }));
   },
 
   _speakInner: function() {
     this._win.speechSynthesis.cancel();
     let tw = this._treeWalker;
     let paragraph = tw.currentNode;
-    if (paragraph == tw.root) {
-      this._sendTestEvent("paragraphsdone", {});
+    if (!paragraph) {
+      tw.currentNode = tw.root;
       return Promise.resolve();
     }
 
     let utterance = new this._win.SpeechSynthesisUtterance(
       paragraph.textContent);
     utterance.rate = this._speechOptions.rate;
     if (this._speechOptions.voice) {
       utterance.voice = this._speechOptions.voice;
@@ -188,17 +188,17 @@ Narrator.prototype = {
         if (this._inTest) {
           this._sendTestEvent("paragraphend", {});
         }
 
         if (this._stopped) {
           // User pressed stopped.
           resolve();
         } else {
-          tw.currentNode = tw.nextNode() || tw.root;
+          tw.nextNode();
           this._speakInner().then(resolve, reject);
         }
       });
 
       utterance.addEventListener("error", () => {
         reject("speech synthesis failed");
       });
 
--- a/toolkit/components/narrate/test/browser_narrate.js
+++ b/toolkit/components/narrate/test/browser_narrate.js
@@ -106,22 +106,16 @@ add_task(function* testNarrate() {
     content.scrollBy(0, -10);
     yield promiseEvent;
     ok(NarrateTestUtils.isVisible(popup), "popup stays visible after scroll");
 
     toggle.click();
     ok(!NarrateTestUtils.isVisible(popup), "popup is dismissed while speaking");
     NarrateTestUtils.isStartedState(content, ok);
 
-    // Go forward all the way to the end of the article. We should eventually
-    // stop.
-    do {
-      promiseEvent = Promise.race([
-        ContentTaskUtils.waitForEvent(content, "paragraphstart"),
-        ContentTaskUtils.waitForEvent(content, "paragraphsdone")]);
-      $(NarrateTestUtils.FORWARD).click();
-    } while ((yield promiseEvent).type == "paragraphstart");
-
+    promiseEvent = ContentTaskUtils.waitForEvent(content, "paragraphend");
+    $(NarrateTestUtils.STOP).click();
+    yield promiseEvent;
     yield ContentTaskUtils.waitForCondition(
       () => !$(NarrateTestUtils.STOP), "transitioned to stopped state");
     NarrateTestUtils.isStoppedState(content, ok);
   });
 });