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

Unified Diff: chrome/browser/ui/views/accessibility/spoken_feedback_chromeos_browsertest.cc

Issue 447893003: Test that simulates touch exploration and checks speech on tabs and also the empty bookmark bar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moved new tests to views Created 6 years, 4 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
Index: chrome/browser/ui/views/accessibility/spoken_feedback_chromeos_browsertest.cc
diff --git a/chrome/browser/ui/views/accessibility/spoken_feedback_chromeos_browsertest.cc b/chrome/browser/ui/views/accessibility/spoken_feedback_chromeos_browsertest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..297f762ab951e735c275d0799f1ef23269ad8b7b
--- /dev/null
+++ b/chrome/browser/ui/views/accessibility/spoken_feedback_chromeos_browsertest.cc
@@ -0,0 +1,63 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
James Cook 2014/08/08 17:06:32 I steered you wrong. This should be spoken_feedbac
evy 2014/08/08 18:37:47 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/strings/string_util.h"
+#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
+#include "chrome/browser/chromeos/accessibility/accessibility_util.h"
+#include "chrome/browser/chromeos/accessibility/speech_monitor.h"
+#include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
+#include "chrome/browser/ui/views/frame/browser_view.h"
+#include "chrome/browser/ui/views/tabs/tab_strip.h"
+#include "chrome/test/base/in_process_browser_test.h"
+
+typedef InProcessBrowserTest SpokenFeedbackViewsTest;
James Cook 2014/08/08 17:06:32 Add a brief comment about why this lives in c/b/ui
evy 2014/08/08 18:37:47 Done.
+
+namespace chromeos {
+
+IN_PROC_BROWSER_TEST_F(SpokenFeedbackViewsTest,
James Cook 2014/08/08 17:06:32 Add a brief comment explaining what you are testin
evy 2014/08/08 18:37:47 Done.
+ TouchExploreBookmarkBarInstructions) {
+ EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
James Cook 2014/08/08 17:06:32 I would ASSERT_FALSE, as this is a precondition fo
evy 2014/08/08 18:37:47 Done.
+ SpeechMonitor monitor;
+ AccessibilityManager::Get()->EnableSpokenFeedback(
+ true, ash::A11Y_NOTIFICATION_NONE);
+ EXPECT_TRUE(monitor.SkipChromeVoxEnabledMessage());
+
+ accessibility::SimulateTouchScreenInChromeVoxForTest(browser()->profile());
+
+ // Send an accessibility hover event on the empty bookmarks bar, which is
+ // what we get when you tap it on a touch screen when ChromeVox is on.
+ BrowserView* browser_view =
+ static_cast<BrowserView*>(browser()->window());
+ BookmarkBarView* bookmarks_bar = browser_view->GetBookmarkBarView();
+ views::View* instructions = bookmarks_bar->GetBookmarkBarInstructionsView();
+ instructions->NotifyAccessibilityEvent(ui::AX_EVENT_HOVER, true);
+
+ EXPECT_EQ("Bookmarks,", monitor.GetNextUtterance());
+ EXPECT_EQ("For quick access,", monitor.GetNextUtterance());
aboxhall 2014/08/08 17:16:01 Possibly consider expressing this in terms of inst
evy 2014/08/08 18:37:47 I thought a bit about that, and I'm glad you broug
aboxhall 2014/08/08 20:01:52 I think on balance it'd probably be over-engineeri
evy 2014/08/08 21:00:28 Acknowledged.
+ EXPECT_EQ("place your bookmarks here on the bookmarks bar.",
+ monitor.GetNextUtterance());
+}
+
+IN_PROC_BROWSER_TEST_F(SpokenFeedbackViewsTest, TouchExploreTabs) {
+ EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
+ SpeechMonitor monitor;
+ AccessibilityManager::Get()->EnableSpokenFeedback(
+ true, ash::A11Y_NOTIFICATION_NONE);
+ EXPECT_TRUE(monitor.SkipChromeVoxEnabledMessage());
+
+ accessibility::SimulateTouchScreenInChromeVoxForTest(browser()->profile());
+
+ // Send an accessibility hover event on a tab in the tap strip, which is
+ // what we get when you tap it on a touch screen when ChromeVox is on.
+ BrowserView* browser_view =
+ static_cast<BrowserView*>(browser()->window());
+ TabStrip* tab_strip = browser_view->tabstrip();
+ ASSERT_EQ(tab_strip->tab_count(), 1);
+
+ Tab* tab = tab_strip->tab_at(0);
+ tab->NotifyAccessibilityEvent(ui::AX_EVENT_HOVER, true);
+ EXPECT_TRUE(MatchPattern(monitor.GetNextUtterance(), "*, tab * of *"));
+}
+
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698