Commit 9859d3c3 authored by bartfab@chromium.org's avatar bartfab@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#289493}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289493 0039d316-1c4b-4281-b951-d872f2087c98
parent 586f5e86
......@@ -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
......@@ -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
......
......@@ -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.
......
// 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
......@@ -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;
......
......@@ -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.
......
......@@ -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!': [
......
......@@ -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",
......
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