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

Unified Diff: content/browser/accessibility/accessibility_test_utils.h

Issue 2009283002: Fix touch accessibility events in WebViews and iframes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable cross-site test temporarily Created 4 years, 7 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: content/browser/accessibility/accessibility_test_utils.h
diff --git a/content/browser/accessibility/accessibility_test_utils.h b/content/browser/accessibility/accessibility_test_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..a82ef1a333e6e8e162a10fd6bf33250caafa8f15
--- /dev/null
+++ b/content/browser/accessibility/accessibility_test_utils.h
@@ -0,0 +1,35 @@
+// Copyright 2016 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.
+
+#ifndef CONTENT_BROWSER_ACCESSIBILITY_ACCESSIBILITY_TEST_UTILS_H_
+#define CONTENT_BROWSER_ACCESSIBILITY_ACCESSIBILITY_TEST_UTILS_H_
+
+#include <string>
+
+namespace content {
+
+class BrowserAccessibility;
+class WebContents;
+
+// Search recursively through the accessibility tree rooted at |node|
+// and return true if any descendant (including in child frames) has
+// a name (ui::AX_ATTR_NAME) that matches |name| exactly.
+bool AccessibilityTreeContainsNodeWithName(BrowserAccessibility* node,
+ const std::string& name);
+
+// This is intended to be a robust way to assert that the accessibility
+// tree eventually gets into the correct state, without worrying about
+// the exact ordering of events received while getting there.
+//
+// Searches the accessibility tree to see if any node's accessible name
+// is equal to the given name. If not, sets up a notification waiter
+// that listens for any accessibility event in any frame, and checks again
+// after each event. Keeps looping until the text is found (or the
+// test times out).
+void WaitForAccessibilityTreeToContainNodeWithName(WebContents* web_contents,
+ const std::string& name);
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_ACCESSIBILITY_ACCESSIBILITY_TEST_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698