Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(401)

Unified Diff: chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc

Issue 2123973004: Define a minimum time for double tap in ChromeVox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/common/key_util.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc
diff --git a/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc b/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc
index fba326fe88bc003fbf5c7e58e9ffbda479fc3d93..e4db34684e5aae27b507c411d6f4ff7c9eadd991 100644
--- a/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc
+++ b/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc
@@ -37,6 +37,7 @@
#include "chromeos/chromeos_switches.h"
#include "chromeos/login/user_names.h"
#include "components/signin/core/account_id/account_id.h"
+#include "content/public/browser/browser_thread.h"
#include "content/public/common/url_constants.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/test_utils.h"
@@ -57,7 +58,7 @@ namespace chromeos {
//
class LoggedInSpokenFeedbackTest : public InProcessBrowserTest {
- protected:
+ public:
LoggedInSpokenFeedbackTest()
: animation_mode_(ui::ScopedAnimationDurationScaleMode::ZERO_DURATION) {}
~LoggedInSpokenFeedbackTest() override {}
@@ -578,7 +579,15 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, ChromeVoxStickyMode) {
// Press the sticky-key sequence: Search Search.
SendKeyPress(ui::VKEY_LWIN);
- SendKeyPress(ui::VKEY_LWIN);
+
+ // Sticky key has a minimum 100 ms check to prevent key repeat from toggling
+ // it.
+ content::BrowserThread::PostDelayedTask(
+ content::BrowserThread::UI, FROM_HERE,
+ base::Bind(&LoggedInSpokenFeedbackTest::SendKeyPress,
+ base::Unretained(this), ui::VKEY_LWIN),
+ base::TimeDelta::FromMilliseconds(200));
+
EXPECT_EQ("Sticky mode enabled", speech_monitor_.GetNextUtterance());
// Even once we hear "sticky mode enabled" from the ChromeVox background
@@ -607,7 +616,15 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, ChromeVoxNextStickyMode) {
// Press the sticky-key sequence: Search Search.
SendKeyPress(ui::VKEY_LWIN);
- SendKeyPress(ui::VKEY_LWIN);
+
+ // Sticky key has a minimum 100 ms check to prevent key repeat from toggling
+ // it.
+ content::BrowserThread::PostDelayedTask(
+ content::BrowserThread::UI, FROM_HERE,
+ base::Bind(&LoggedInSpokenFeedbackTest::SendKeyPress,
+ base::Unretained(this), ui::VKEY_LWIN),
+ base::TimeDelta::FromMilliseconds(200));
+
EXPECT_EQ("Sticky mode enabled", speech_monitor_.GetNextUtterance());
SendKeyPress(ui::VKEY_H);
@@ -615,7 +632,15 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, ChromeVoxNextStickyMode) {
}
SendKeyPress(ui::VKEY_LWIN);
- SendKeyPress(ui::VKEY_LWIN);
+
+ // Sticky key has a minimum 100 ms check to prevent key repeat from toggling
+ // it.
+ content::BrowserThread::PostDelayedTask(
+ content::BrowserThread::UI, FROM_HERE,
+ base::Bind(&LoggedInSpokenFeedbackTest::SendKeyPress,
+ base::Unretained(this), ui::VKEY_LWIN),
+ base::TimeDelta::FromMilliseconds(200));
+
while ("Sticky mode disabled" != speech_monitor_.GetNextUtterance()) {
}
}
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/common/key_util.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698