Bug 1262006 - Swap narrate start/stop button tooltip states. r=Gijs
MozReview-Commit-ID: 4cRneVhQclY
--- a/toolkit/components/narrate/NarrateControls.jsm
+++ b/toolkit/components/narrate/NarrateControls.jsm
@@ -185,17 +185,17 @@ NarrateControls.prototype = {
_updateSpeechControls: function(speaking) {
let dropdown = this._doc.getElementById("narrate-dropdown");
dropdown.classList.toggle("keep-open", speaking);
let startStopButton = this._doc.getElementById("narrate-start-stop");
startStopButton.classList.toggle("speaking", speaking);
startStopButton.title =
- gStrings.GetStringFromName(speaking ? "start" : "stop");
+ gStrings.GetStringFromName(speaking ? "stop" : "start");
this._doc.getElementById("narrate-skip-previous").disabled = !speaking;
this._doc.getElementById("narrate-skip-next").disabled = !speaking;
},
_createVoiceLabel: function(voice) {
// This is a highly imperfect method of making human-readable labels
// for system voices. Because each platform has a different naming scheme
--- a/toolkit/components/narrate/test/NarrateTestUtils.jsm
+++ b/toolkit/components/narrate/test/NarrateTestUtils.jsm
@@ -42,24 +42,28 @@ this.NarrateTestUtils = {
},
isStoppedState: function(window, ok) {
let $ = window.document.querySelector.bind(window.document);
ok($(this.BACK).disabled, "back button is disabled");
ok($(this.FORWARD).disabled, "forward button is disabled");
ok(!!$(this.START), "start button is showing");
ok(!$(this.STOP), "stop button is hidden");
+ // This checks for a localized label. Not the best...
+ ok($(this.START).title == "Start", "Button tooltip is correct");
},
isStartedState: function(window, ok) {
let $ = window.document.querySelector.bind(window.document);
ok(!$(this.BACK).disabled, "back button is enabled");
ok(!$(this.FORWARD).disabled, "forward button is enabled");
ok(!$(this.START), "start button is hidden");
ok(!!$(this.STOP), "stop button is showing");
+ // This checks for a localized label. Not the best...
+ ok($(this.STOP).title == "Stop", "Button tooltip is correct");
},
selectVoice: function(window, voiceUri) {
if (!this.isVisible(window.document.querySelector(this.VOICE_OPTIONS))) {
window.document.querySelector(this.VOICE_SELECT).click();
}
let voiceOption = window.document.querySelector(
--- a/toolkit/components/narrate/test/browser.ini
+++ b/toolkit/components/narrate/test/browser.ini
@@ -1,8 +1,9 @@
[DEFAULT]
support-files =
head.js
NarrateTestUtils.jsm
+ !/browser/base/content/test/general/readerModeArticle.html
[browser_narrate.js]
[browser_narrate_disable.js]
[browser_voiceselect.js]