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

Unified Diff: content/shell/renderer/test_runner/web_ax_object_proxy.cc

Issue 833483002: Adds API for testing aria-controls/flowto/owns properties. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing indentation Created 5 years, 11 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
« no previous file with comments | « content/shell/renderer/test_runner/web_ax_object_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/renderer/test_runner/web_ax_object_proxy.cc
diff --git a/content/shell/renderer/test_runner/web_ax_object_proxy.cc b/content/shell/renderer/test_runner/web_ax_object_proxy.cc
index a915490a6d422ee7f2f092d28718f68260f51eec..2f12d70fd9ffeb6ff41432f45e2ca35248095cf5 100644
--- a/content/shell/renderer/test_runner/web_ax_object_proxy.cc
+++ b/content/shell/renderer/test_runner/web_ax_object_proxy.cc
@@ -515,6 +515,12 @@ WebAXObjectProxy::GetObjectTemplateBuilder(v8::Isolate* isolate) {
.SetMethod("allAttributes", &WebAXObjectProxy::AllAttributes)
.SetMethod("attributesOfChildren",
&WebAXObjectProxy::AttributesOfChildren)
+ .SetMethod("ariaControlsElementAtIndex",
+ &WebAXObjectProxy::AriaControlsElementAtIndex)
+ .SetMethod("ariaFlowToElementAtIndex",
+ &WebAXObjectProxy::AriaFlowToElementAtIndex)
+ .SetMethod("ariaOwnsElementAtIndex",
+ &WebAXObjectProxy::AriaOwnsElementAtIndex)
.SetMethod("lineForIndex", &WebAXObjectProxy::LineForIndex)
.SetMethod("boundsForRange", &WebAXObjectProxy::BoundsForRange)
.SetMethod("childAtIndex", &WebAXObjectProxy::ChildAtIndex)
@@ -818,6 +824,44 @@ bool WebAXObjectProxy::IsButtonStateMixed() {
return accessibility_object_.isButtonStateMixed();
}
+v8::Handle<v8::Object> WebAXObjectProxy::AriaControlsElementAtIndex(
+ unsigned index)
+{
+ accessibility_object_.updateLayoutAndCheckValidity();
+ blink::WebVector<blink::WebAXObject> elements;
+ accessibility_object_.ariaControls(elements);
+ size_t elementCount = elements.size();
+ if (index >= elementCount)
+ return v8::Handle<v8::Object>();
+
+ return factory_->GetOrCreate(elements[index]);
+}
+
+v8::Handle<v8::Object> WebAXObjectProxy::AriaFlowToElementAtIndex(
+ unsigned index)
+{
+ accessibility_object_.updateLayoutAndCheckValidity();
+ blink::WebVector<blink::WebAXObject> elements;
+ accessibility_object_.ariaFlowTo(elements);
+ size_t elementCount = elements.size();
+ if (index >= elementCount)
+ return v8::Handle<v8::Object>();
+
+ return factory_->GetOrCreate(elements[index]);
+}
+
+v8::Handle<v8::Object> WebAXObjectProxy::AriaOwnsElementAtIndex(unsigned index)
+{
+ accessibility_object_.updateLayoutAndCheckValidity();
+ blink::WebVector<blink::WebAXObject> elements;
+ accessibility_object_.ariaOwns(elements);
+ size_t elementCount = elements.size();
+ if (index >= elementCount)
+ return v8::Handle<v8::Object>();
+
+ return factory_->GetOrCreate(elements[index]);
+}
+
std::string WebAXObjectProxy::AllAttributes() {
accessibility_object_.updateLayoutAndCheckValidity();
return GetAttributes(accessibility_object_);
« no previous file with comments | « content/shell/renderer/test_runner/web_ax_object_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698