Commit b51be3cb authored by Akihiro Ota's avatar Akihiro Ota Committed by Commit Bot

Promote doCmd to ChromeVoxNextE2ETest

Remove repeated declarations of doCmd in the ChromeVox testing code by
promoting it to ChromeVoxNextE2ETest.

Bug: 1127449
Change-Id: I9d15640894a7f06e8ae3f78e06b50c6173df55c6
AX-Relnotes: N/A
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2406379Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Commit-Queue: Akihiro Ota <akihiroota@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806343}
parent 78c4c3e4
......@@ -52,17 +52,6 @@ ChromeVoxAnnotationTest = class extends ChromeVoxNextE2ETest {
return mockFeedback;
}
/**
* Create a function which performs the command |cmd|.
* @param {string} cmd
* @return {function(): void}
*/
doCmd(cmd) {
return function() {
CommandHandler.onCommand(cmd);
};
}
/**
* Returns the start node of the current ChromeVox range.
* @return {AutomationNode}
......
......@@ -34,17 +34,6 @@ ChromeVoxBackgroundTest = class extends ChromeVoxNextE2ETest {
return mockFeedback;
}
/**
* Create a function which perform the command |cmd|.
* @param {string} cmd
* @return {function() : void}
*/
doCmd(cmd) {
return function() {
CommandHandler.onCommand(cmd);
};
}
doGesture(gesture) {
return () => {
GestureCommandHandler.onAccessibilityGesture_(gesture);
......
......@@ -31,17 +31,6 @@ ChromeVoxLiveRegionsTest = class extends ChromeVoxNextE2ETest {
return mockFeedback;
}
/**
* Create a function which performs the command |cmd|.
* @param {string} cmd
* @return {function() : void}
*/
doCmd(cmd) {
return function() {
CommandHandler.onCommand(cmd);
};
}
/**
* Simulates work done when users interact using keyboard, braille, or
* touch.
......
......@@ -56,17 +56,6 @@ ChromeVoxLocaleOutputHelperTest = class extends ChromeVoxNextE2ETest {
return mockFeedback;
}
/**
* Create a function which performs the command |cmd|.
* @param {string} cmd
* @return {function(): void}
*/
doCmd(cmd) {
return function() {
CommandHandler.onCommand(cmd);
};
}
/**
* Calls mock version of chrome.tts.getVoices() to populate
* LocaleOutputHelper's available voice list with a specific set of voices.
......
......@@ -31,17 +31,6 @@ ChromeVoxPortalsTest = class extends ChromeVoxNextE2ETest {
return true;
}
/**
* Create a function which perform the command |cmd|.
* @param {string} cmd
* @return {function() : void}
*/
doCmd(cmd) {
return function() {
CommandHandler.onCommand(cmd);
};
}
/**
* Waits for |portal|'s tree to be ready.
* @param {chrome.automation.AutomationNode} portal
......
......@@ -13,11 +13,7 @@ GEN_INCLUDE(['../testing/mock_feedback.js', '../testing/fake_objects.js']);
ChromeVoxSettingsPagesTest = class extends ChromeVoxNextE2ETest {
/** @override */
setUp() {
window.doCmd = (command) => {
return () => {
CommandHandler.onCommand(command);
};
};
window.doCmd = this.doCmd;
}
/** @override */
......
......@@ -34,6 +34,17 @@ ChromeVoxNextE2ETest = class extends ChromeVoxE2ETest {
}
}
/**
* Create a function which performs the command |cmd|.
* @param {string} cmd
* @return {function(): void}
*/
doCmd(cmd) {
return () => {
CommandHandler.onCommand(cmd);
};
}
/**
* Dependencies defined on a background window other than this one.
* @type {!Array<string>}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment