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

Unified Diff: chrome/browser/chromeos/accessibility/accessibility_util.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/chromeos/accessibility/accessibility_util.cc
diff --git a/chrome/browser/chromeos/accessibility/accessibility_util.cc b/chrome/browser/chromeos/accessibility/accessibility_util.cc
index 3d2d95d4a1f146a7b5c19e0515ed3129079ba6ff..e5e17d1dbf52011a95065f21feac8ae68eb8a1ca 100644
--- a/chrome/browser/chromeos/accessibility/accessibility_util.cc
+++ b/chrome/browser/chromeos/accessibility/accessibility_util.cc
@@ -7,8 +7,13 @@
#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
@@ -38,5 +43,19 @@ 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(),
+ "window.ontouchstart = function() {};"));
aboxhall 2014/08/08 17:16:01 Perhaps to be a little safer: "if (!('ontouchstart
evy 2014/08/08 18:37:47 This code was actually moved over from another fil
aboxhall 2014/08/08 18:54:30 Yeah, I did see it in the other file after I made
evy 2014/08/08 19:15:38 Makes sense! Thanks for the explanation + suggesti
+}
+
} // namespace accessibility
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698