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

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

Issue 796373002: New API to test table headers at specified index. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adjusting function names to the new API. Created 6 years 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 ec01d82bb5fef41a2482cce82c1c62f95b008115..a11904c046a6c3e01e3c0e44422edabcf3251a96 100644
--- a/content/shell/renderer/test_runner/web_ax_object_proxy.cc
+++ b/content/shell/renderer/test_runner/web_ax_object_proxy.cc
@@ -518,6 +518,8 @@ WebAXObjectProxy::GetObjectTemplateBuilder(v8::Isolate* isolate) {
.SetMethod("childAtIndex", &WebAXObjectProxy::ChildAtIndex)
.SetMethod("elementAtPoint", &WebAXObjectProxy::ElementAtPoint)
.SetMethod("tableHeader", &WebAXObjectProxy::TableHeader)
+ .SetMethod("rowHeaderAtIndex", &WebAXObjectProxy::RowHeaderAtIndex)
+ .SetMethod("columnHeaderAtIndex", &WebAXObjectProxy::ColumnHeaderAtIndex)
.SetMethod("rowIndexRange", &WebAXObjectProxy::RowIndexRange)
.SetMethod("columnIndexRange", &WebAXObjectProxy::ColumnIndexRange)
.SetMethod("cellForColumnAndRow", &WebAXObjectProxy::CellForColumnAndRow)
@@ -890,6 +892,28 @@ v8::Handle<v8::Object> WebAXObjectProxy::TableHeader() {
return factory_->GetOrCreate(obj);
}
+v8::Handle<v8::Object> WebAXObjectProxy::RowHeaderAtIndex(unsigned index) {
+ accessibility_object_.updateLayoutAndCheckValidity();
+ blink::WebVector<blink::WebAXObject> headers;
+ accessibility_object_.rowHeaders(headers);
+ size_t headerCount = headers.size();
+ if (index >= headerCount)
+ return v8::Handle<v8::Object>();
+
+ return factory_->GetOrCreate(headers[index]);
+}
+
+v8::Handle<v8::Object> WebAXObjectProxy::ColumnHeaderAtIndex(unsigned index) {
+ accessibility_object_.updateLayoutAndCheckValidity();
+ blink::WebVector<blink::WebAXObject> headers;
+ accessibility_object_.columnHeaders(headers);
+ size_t headerCount = headers.size();
+ if (index >= headerCount)
+ return v8::Handle<v8::Object>();
+
+ return factory_->GetOrCreate(headers[index]);
+}
+
std::string WebAXObjectProxy::RowIndexRange() {
accessibility_object_.updateLayoutAndCheckValidity();
unsigned row_index = accessibility_object_.cellRowIndex();
« 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