summaryrefslogtreecommitdiffstats
path: root/toolkit/components/narrate/test/browser_voiceselect.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-02-25 15:07:00 -0500
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-04-14 12:55:19 +0200
commiteb70e6e3d0bff11c25f14b1196025791bf2308fb (patch)
tree5ef4ce17db83c74d7b05ec12c8f59e095a6dd5bd /toolkit/components/narrate/test/browser_voiceselect.js
parent32ead795290b3399d56b4708fc75b77d296f6a1a (diff)
downloadUXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar
UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.gz
UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.lz
UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.xz
UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.zip
Issue #439 - Remove tests from toolkit/
Diffstat (limited to 'toolkit/components/narrate/test/browser_voiceselect.js')
-rw-r--r--toolkit/components/narrate/test/browser_voiceselect.js112
1 files changed, 0 insertions, 112 deletions
diff --git a/toolkit/components/narrate/test/browser_voiceselect.js b/toolkit/components/narrate/test/browser_voiceselect.js
deleted file mode 100644
index 0de6528dd..000000000
--- a/toolkit/components/narrate/test/browser_voiceselect.js
+++ /dev/null
@@ -1,112 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* globals registerCleanupFunction, add_task, is, isnot */
-
-"use strict";
-
-registerCleanupFunction(teardown);
-
-add_task(function* testVoiceselectDropdownAutoclose() {
- setup();
-
- yield spawnInNewReaderTab(TEST_ARTICLE, function* () {
- let $ = content.document.querySelector.bind(content.document);
-
- yield NarrateTestUtils.waitForNarrateToggle(content);
-
- $(NarrateTestUtils.TOGGLE).click();
- ok(NarrateTestUtils.isVisible($(NarrateTestUtils.POPUP)),
- "popup is toggled");
-
- ok(!NarrateTestUtils.isVisible($(NarrateTestUtils.VOICE_OPTIONS)),
- "voice options are initially hidden");
-
- $(NarrateTestUtils.VOICE_SELECT).click();
- ok(NarrateTestUtils.isVisible($(NarrateTestUtils.VOICE_OPTIONS)),
- "voice options are toggled");
-
- $(NarrateTestUtils.TOGGLE).click();
- // A focus will follow a real click.
- $(NarrateTestUtils.TOGGLE).focus();
- ok(!NarrateTestUtils.isVisible($(NarrateTestUtils.POPUP)),
- "narrate popup is dismissed");
-
- $(NarrateTestUtils.TOGGLE).click();
- // A focus will follow a real click.
- $(NarrateTestUtils.TOGGLE).focus();
- ok(NarrateTestUtils.isVisible($(NarrateTestUtils.POPUP)),
- "narrate popup is showing again");
- ok(!NarrateTestUtils.isVisible($(NarrateTestUtils.VOICE_OPTIONS)),
- "voice options are hidden after popup comes back");
- });
-});
-
-add_task(function* testVoiceselectLabelChange() {
- setup();
-
- yield spawnInNewReaderTab(TEST_ARTICLE, function* () {
- let $ = content.document.querySelector.bind(content.document);
-
- yield NarrateTestUtils.waitForNarrateToggle(content);
-
- $(NarrateTestUtils.TOGGLE).click();
- ok(NarrateTestUtils.isVisible($(NarrateTestUtils.POPUP)),
- "popup is toggled");
-
- ok(NarrateTestUtils.selectVoice(content, "urn:moz-tts:fake-direct:lenny"),
- "voice selected");
-
- let selectedOption = $(NarrateTestUtils.VOICE_SELECTED);
- let selectLabel = $(NarrateTestUtils.VOICE_SELECT_LABEL);
-
- is(selectedOption.textContent, selectLabel.textContent,
- "new label matches selected voice");
- });
-});
-
-add_task(function* testVoiceselectKeyboard() {
- setup();
-
- yield spawnInNewReaderTab(TEST_ARTICLE, function* () {
- let $ = content.document.querySelector.bind(content.document);
-
- yield NarrateTestUtils.waitForNarrateToggle(content);
-
- $(NarrateTestUtils.TOGGLE).click();
- ok(NarrateTestUtils.isVisible($(NarrateTestUtils.POPUP)),
- "popup is toggled");
-
- let eventUtils = NarrateTestUtils.getEventUtils(content);
-
- let firstValue = $(NarrateTestUtils.VOICE_SELECTED).dataset.value;
-
- ok(!NarrateTestUtils.isVisible($(NarrateTestUtils.VOICE_OPTIONS)),
- "voice options initially are hidden");
-
- $(NarrateTestUtils.VOICE_SELECT).focus();
-
- eventUtils.sendKey("DOWN", content);
-
- yield ContentTaskUtils.waitForCondition(
- () => $(NarrateTestUtils.VOICE_SELECTED).dataset.value != firstValue,
- "value changed after pressing DOWN key");
-
- eventUtils.sendKey("RETURN", content);
-
- ok(NarrateTestUtils.isVisible($(NarrateTestUtils.VOICE_OPTIONS)),
- "voice options showing after pressing RETURN");
-
- eventUtils.sendKey("UP", content);
-
- eventUtils.sendKey("RETURN", content);
-
- ok(!NarrateTestUtils.isVisible($(NarrateTestUtils.VOICE_OPTIONS)),
- "voice options hidden after pressing RETURN");
-
- yield ContentTaskUtils.waitForCondition(
- () => $(NarrateTestUtils.VOICE_SELECTED).dataset.value == firstValue,
- "value changed back to original after pressing RETURN");
- });
-});