summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbartfab@chromium.org <bartfab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-14 08:34:50 +0000
committerbartfab@chromium.org <bartfab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-14 08:34:50 +0000
commite86ea99c52e63c3a2caf3c3fbc705199e9216f2c (patch)
treecced7629398efcbd9ad6eb7169e221f7f7637186
parent97e5b6f6555ee8c857b4a8f351f88b6794f659e8 (diff)
downloadchromium_src-e86ea99c52e63c3a2caf3c3fbc705199e9216f2c.zip
chromium_src-e86ea99c52e63c3a2caf3c3fbc705199e9216f2c.tar.gz
chromium_src-e86ea99c52e63c3a2caf3c3fbc705199e9216f2c.tar.bz2
Revert 289488 "Test that simulates touch exploration and checks ..."
This caused a compile failure on the Chrome OS bots: http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Builder%20%28dbg%29/builds/50095/steps/compile/logs/stdio > Test that simulates touch exploration and checks speech on tabs and also the empty bookmark bar. > > BUG=393768, 395895 > > Review URL: https://codereview.chromium.org/447893003 TBR=evy@chromium.org Review URL: https://codereview.chromium.org/463373005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289493 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/accessibility/accessibility_util.cc20
-rw-r--r--chrome/browser/chromeos/accessibility/accessibility_util.h6
-rw-r--r--chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc19
-rw-r--r--chrome/browser/ui/views/accessibility/spoken_feedback_chromeos_views_browsertest.cc72
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc6
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bar_view.h3
-rw-r--r--chrome/chrome_tests.gypi3
-rw-r--r--chrome/common/extensions/api/accessibility_private.json2
8 files changed, 18 insertions, 113 deletions
diff --git a/chrome/browser/chromeos/accessibility/accessibility_util.cc b/chrome/browser/chromeos/accessibility/accessibility_util.cc
index 949b9f2..3d2d95d 100644
--- a/chrome/browser/chromeos/accessibility/accessibility_util.cc
+++ b/chrome/browser/chromeos/accessibility/accessibility_util.cc
@@ -7,13 +7,8 @@
#include "base/prefs/pref_service.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/ui/singleton_tabs.h"
-#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
-#include "content/public/test/browser_test_utils.h"
-#include "extensions/browser/extension_host.h"
-#include "extensions/browser/extension_system.h"
-#include "extensions/browser/process_manager.h"
#include "url/gurl.h"
// TODO(yoshiki): move the following method to accessibility_manager.cc and
@@ -43,20 +38,5 @@ void ShowAccessibilityHelp(Browser* browser) {
chrome::ShowSingletonTab(browser, GURL(chrome::kChromeAccessibilityHelpURL));
}
-
-void SimulateTouchScreenInChromeVoxForTest(content::BrowserContext* profile) {
- // ChromeVox looks at whether 'ontouchstart' exists to know whether or not it
- // should respond to hover events. Fake it so that touch exploration events
- // get spoken.
- extensions::ExtensionHost* host =
- extensions::ExtensionSystem::Get(profile)
- ->process_manager()
- ->GetBackgroundHostForExtension(
- extension_misc::kChromeVoxExtensionId);
- CHECK(content::ExecuteScript(
- host->host_contents(),
- "if (!('ontouchstart' in window)) window.ontouchstart = function() {};"));
-}
-
} // namespace accessibility
} // namespace chromeos
diff --git a/chrome/browser/chromeos/accessibility/accessibility_util.h b/chrome/browser/chromeos/accessibility/accessibility_util.h
index b4d2e58..7f70312 100644
--- a/chrome/browser/chromeos/accessibility/accessibility_util.h
+++ b/chrome/browser/chromeos/accessibility/accessibility_util.h
@@ -7,10 +7,6 @@
class Browser;
-namespace content {
-class BrowserContext;
-}
-
namespace chromeos {
namespace accessibility {
@@ -23,8 +19,6 @@ bool IsVirtualKeyboardEnabled();
// Shows the accessibility help tab on the browser.
void ShowAccessibilityHelp(Browser* browser);
-void SimulateTouchScreenInChromeVoxForTest(content::BrowserContext* profile);
-
} // namespace accessibility
} // namespace chromeos
diff --git a/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc b/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc
index 5cfb990..56108d6 100644
--- a/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc
+++ b/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc
@@ -10,7 +10,6 @@
#include "base/strings/string_util.h"
#include "chrome/app/chrome_command_ids.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/chromeos/login/ui/login_display_host.h"
#include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
@@ -23,6 +22,7 @@
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/extensions/extension_constants.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/interactive_test_utils.h"
#include "chrome/test/base/testing_profile.h"
@@ -32,6 +32,8 @@
#include "content/public/common/url_constants.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/test_utils.h"
+#include "extensions/browser/extension_host.h"
+#include "extensions/browser/process_manager.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/test/ui_controls.h"
#include "ui/views/widget/widget.h"
@@ -65,6 +67,19 @@ class LoggedInSpokenFeedbackTest : public InProcessBrowserTest {
root_window, key, false, false, false, false));
}
+ void SimulateTouchScreenInChromeVox() {
+ // ChromeVox looks at whether 'ontouchstart' exists to know whether
+ // or not it should respond to hover events. Fake it so that touch
+ // exploration events get spoken.
+ extensions::ExtensionHost* host =
+ extensions::ExtensionSystem::Get(browser()->profile())->
+ process_manager()->GetBackgroundHostForExtension(
+ extension_misc::kChromeVoxExtensionId);
+ CHECK(content::ExecuteScript(
+ host->host_contents(),
+ "window.ontouchstart = function() {};"));
+ }
+
private:
StubBrailleController braille_controller_;
DISALLOW_COPY_AND_ASSIGN(LoggedInSpokenFeedbackTest);
@@ -217,7 +232,7 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, TouchExploreStatusTray) {
true, ash::A11Y_NOTIFICATION_NONE);
EXPECT_TRUE(monitor.SkipChromeVoxEnabledMessage());
- accessibility::SimulateTouchScreenInChromeVoxForTest(browser()->profile());
+ SimulateTouchScreenInChromeVox();
// Send an accessibility hover event on the system tray, which is
// what we get when you tap it on a touch screen when ChromeVox is on.
diff --git a/chrome/browser/ui/views/accessibility/spoken_feedback_chromeos_views_browsertest.cc b/chrome/browser/ui/views/accessibility/spoken_feedback_chromeos_views_browsertest.cc
deleted file mode 100644
index 7574285..0000000
--- a/chrome/browser/ui/views/accessibility/spoken_feedback_chromeos_views_browsertest.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// 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"
-
-// There are spoken feedback tests in browser/chromeos/accessibility but
-// these tests rely on browser views, so they have been placed in this file
-// in the views directory. The shared function between the spoken feedback
-// tests that simulates the touch screen with ChromeVox is kept in the
-// accessiblity utils file.
-typedef InProcessBrowserTest SpokenFeedbackViewsTest;
-
-namespace chromeos {
-
-// Fetch the bookmark bar instructions view from the browser and trigger an
-// accessibilty event on the view to ensure the correct text is being read.
-IN_PROC_BROWSER_TEST_F(SpokenFeedbackViewsTest,
- TouchExploreBookmarkBarInstructions) {
- ASSERT_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 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());
- EXPECT_EQ("place your bookmarks here on the bookmarks bar.",
- monitor.GetNextUtterance());
-}
-
-// Fetch a tab view from the browser and trigger an accessibilty event on the
-// view to ensure the correct text is being read.
-IN_PROC_BROWSER_TEST_F(SpokenFeedbackViewsTest, TouchExploreTabs) {
- ASSERT_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
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
index 25af20a..7292a6e 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -626,12 +626,6 @@ views::MenuItemView* BookmarkBarView::GetDropMenu() {
return bookmark_drop_menu_ ? bookmark_drop_menu_->menu() : NULL;
}
-views::View* BookmarkBarView::GetBookmarkBarInstructionsView() {
- if (instructions_->visible())
- return instructions_;
- return NULL;
-}
-
void BookmarkBarView::StopThrobbing(bool immediate) {
if (!throbbing_view_)
return;
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h
index 5d6d8a6..8c072bd 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h
@@ -142,9 +142,6 @@ class BookmarkBarView : public DetachableToolbarView,
// Returns the drop MenuItemView, or NULL if a menu isn't showing.
views::MenuItemView* GetDropMenu();
- // Returns the BookmarkBarInstructionView, or NULL if it isn't showing.
- views::View* GetBookmarkBarInstructionsView();
-
// If a button is currently throbbing, it is stopped. If immediate is true
// the throb stops immediately, otherwise it stops after a couple more
// throbs.
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index 851f26b..b81c557 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -280,8 +280,6 @@
}],
],
'sources': [
- 'browser/chromeos/accessibility/accessibility_util.cc',
- 'browser/chromeos/accessibility/accessibility_util.h',
'browser/chromeos/accessibility/speech_monitor.cc',
'browser/chromeos/accessibility/speech_monitor.h',
'browser/chromeos/accessibility/spoken_feedback_browsertest.cc',
@@ -304,7 +302,6 @@
'browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc',
'browser/chromeos/login/users/wallpaper/wallpaper_manager_test_utils.cc',
'browser/chromeos/login/users/wallpaper/wallpaper_manager_test_utils.h',
- 'browser/ui/views/accessibility/spoken_feedback_chromeos_views_browsertest.cc',
'test/data/chromeos/service_login.html',
],
'sources!': [
diff --git a/chrome/common/extensions/api/accessibility_private.json b/chrome/common/extensions/api/accessibility_private.json
index 18c8e9d..bdc3520 100644
--- a/chrome/common/extensions/api/accessibility_private.json
+++ b/chrome/common/extensions/api/accessibility_private.json
@@ -131,7 +131,7 @@
"type": {
"type": "string",
"description": "The type of this object, which determines the contents of 'details'.",
- "enum": ["alert", "button", "checkbox", "combobox", "link", "menu", "menuitem", "radiobutton", "slider", "statictext", "tab", "textbox", "tree", "treeitem", "window"]
+ "enum": ["alert", "button", "checkbox", "combobox", "link", "menu", "menuitem", "radiobutton", "slider", "tab", "textbox", "tree", "treeitem", "window"]
},
"name": {
"type": "string",