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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/shell/renderer/test_runner/web_ax_object_proxy.h" 5 #include "content/shell/renderer/test_runner/web_ax_object_proxy.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "gin/handle.h" 8 #include "gin/handle.h"
9 #include "third_party/WebKit/public/platform/WebPoint.h" 9 #include "third_party/WebKit/public/platform/WebPoint.h"
10 #include "third_party/WebKit/public/platform/WebRect.h" 10 #include "third_party/WebKit/public/platform/WebRect.h"
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 .SetProperty("orientation", &WebAXObjectProxy::Orientation) 508 .SetProperty("orientation", &WebAXObjectProxy::Orientation)
509 .SetProperty("clickPointX", &WebAXObjectProxy::ClickPointX) 509 .SetProperty("clickPointX", &WebAXObjectProxy::ClickPointX)
510 .SetProperty("clickPointY", &WebAXObjectProxy::ClickPointY) 510 .SetProperty("clickPointY", &WebAXObjectProxy::ClickPointY)
511 .SetProperty("rowCount", &WebAXObjectProxy::RowCount) 511 .SetProperty("rowCount", &WebAXObjectProxy::RowCount)
512 .SetProperty("columnCount", &WebAXObjectProxy::ColumnCount) 512 .SetProperty("columnCount", &WebAXObjectProxy::ColumnCount)
513 .SetProperty("isClickable", &WebAXObjectProxy::IsClickable) 513 .SetProperty("isClickable", &WebAXObjectProxy::IsClickable)
514 .SetProperty("isButtonStateMixed", &WebAXObjectProxy::IsButtonStateMixed) 514 .SetProperty("isButtonStateMixed", &WebAXObjectProxy::IsButtonStateMixed)
515 .SetMethod("allAttributes", &WebAXObjectProxy::AllAttributes) 515 .SetMethod("allAttributes", &WebAXObjectProxy::AllAttributes)
516 .SetMethod("attributesOfChildren", 516 .SetMethod("attributesOfChildren",
517 &WebAXObjectProxy::AttributesOfChildren) 517 &WebAXObjectProxy::AttributesOfChildren)
518 .SetMethod("ariaControlsElementAtIndex",
519 &WebAXObjectProxy::AriaControlsElementAtIndex)
520 .SetMethod("ariaFlowToElementAtIndex",
521 &WebAXObjectProxy::AriaFlowToElementAtIndex)
522 .SetMethod("ariaOwnsElementAtIndex",
523 &WebAXObjectProxy::AriaOwnsElementAtIndex)
518 .SetMethod("lineForIndex", &WebAXObjectProxy::LineForIndex) 524 .SetMethod("lineForIndex", &WebAXObjectProxy::LineForIndex)
519 .SetMethod("boundsForRange", &WebAXObjectProxy::BoundsForRange) 525 .SetMethod("boundsForRange", &WebAXObjectProxy::BoundsForRange)
520 .SetMethod("childAtIndex", &WebAXObjectProxy::ChildAtIndex) 526 .SetMethod("childAtIndex", &WebAXObjectProxy::ChildAtIndex)
521 .SetMethod("elementAtPoint", &WebAXObjectProxy::ElementAtPoint) 527 .SetMethod("elementAtPoint", &WebAXObjectProxy::ElementAtPoint)
522 .SetMethod("tableHeader", &WebAXObjectProxy::TableHeader) 528 .SetMethod("tableHeader", &WebAXObjectProxy::TableHeader)
523 .SetMethod("rowHeaderAtIndex", &WebAXObjectProxy::RowHeaderAtIndex) 529 .SetMethod("rowHeaderAtIndex", &WebAXObjectProxy::RowHeaderAtIndex)
524 .SetMethod("columnHeaderAtIndex", &WebAXObjectProxy::ColumnHeaderAtIndex) 530 .SetMethod("columnHeaderAtIndex", &WebAXObjectProxy::ColumnHeaderAtIndex)
525 .SetMethod("rowIndexRange", &WebAXObjectProxy::RowIndexRange) 531 .SetMethod("rowIndexRange", &WebAXObjectProxy::RowIndexRange)
526 .SetMethod("columnIndexRange", &WebAXObjectProxy::ColumnIndexRange) 532 .SetMethod("columnIndexRange", &WebAXObjectProxy::ColumnIndexRange)
527 .SetMethod("cellForColumnAndRow", &WebAXObjectProxy::CellForColumnAndRow) 533 .SetMethod("cellForColumnAndRow", &WebAXObjectProxy::CellForColumnAndRow)
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 bool WebAXObjectProxy::IsClickable() { 817 bool WebAXObjectProxy::IsClickable() {
812 accessibility_object_.updateLayoutAndCheckValidity(); 818 accessibility_object_.updateLayoutAndCheckValidity();
813 return accessibility_object_.isClickable(); 819 return accessibility_object_.isClickable();
814 } 820 }
815 821
816 bool WebAXObjectProxy::IsButtonStateMixed() { 822 bool WebAXObjectProxy::IsButtonStateMixed() {
817 accessibility_object_.updateLayoutAndCheckValidity(); 823 accessibility_object_.updateLayoutAndCheckValidity();
818 return accessibility_object_.isButtonStateMixed(); 824 return accessibility_object_.isButtonStateMixed();
819 } 825 }
820 826
827 v8::Handle<v8::Object> WebAXObjectProxy::AriaControlsElementAtIndex(
828 unsigned index)
829 {
830 accessibility_object_.updateLayoutAndCheckValidity();
831 blink::WebVector<blink::WebAXObject> elements;
832 accessibility_object_.ariaControls(elements);
833 size_t elementCount = elements.size();
834 if (index >= elementCount)
835 return v8::Handle<v8::Object>();
836
837 return factory_->GetOrCreate(elements[index]);
838 }
839
840 v8::Handle<v8::Object> WebAXObjectProxy::AriaFlowToElementAtIndex(
841 unsigned index)
842 {
843 accessibility_object_.updateLayoutAndCheckValidity();
844 blink::WebVector<blink::WebAXObject> elements;
845 accessibility_object_.ariaFlowTo(elements);
846 size_t elementCount = elements.size();
847 if (index >= elementCount)
848 return v8::Handle<v8::Object>();
849
850 return factory_->GetOrCreate(elements[index]);
851 }
852
853 v8::Handle<v8::Object> WebAXObjectProxy::AriaOwnsElementAtIndex(unsigned index)
854 {
855 accessibility_object_.updateLayoutAndCheckValidity();
856 blink::WebVector<blink::WebAXObject> elements;
857 accessibility_object_.ariaOwns(elements);
858 size_t elementCount = elements.size();
859 if (index >= elementCount)
860 return v8::Handle<v8::Object>();
861
862 return factory_->GetOrCreate(elements[index]);
863 }
864
821 std::string WebAXObjectProxy::AllAttributes() { 865 std::string WebAXObjectProxy::AllAttributes() {
822 accessibility_object_.updateLayoutAndCheckValidity(); 866 accessibility_object_.updateLayoutAndCheckValidity();
823 return GetAttributes(accessibility_object_); 867 return GetAttributes(accessibility_object_);
824 } 868 }
825 869
826 std::string WebAXObjectProxy::AttributesOfChildren() { 870 std::string WebAXObjectProxy::AttributesOfChildren() {
827 accessibility_object_.updateLayoutAndCheckValidity(); 871 accessibility_object_.updateLayoutAndCheckValidity();
828 AttributesCollector collector; 872 AttributesCollector collector;
829 unsigned size = accessibility_object_.childCount(); 873 unsigned size = accessibility_object_.childCount();
830 for (unsigned i = 0; i < size; ++i) 874 for (unsigned i = 0; i < size; ++i)
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 v8::Handle<v8::Value> value_handle = gin::CreateHandle( 1183 v8::Handle<v8::Value> value_handle = gin::CreateHandle(
1140 isolate, new RootWebAXObjectProxy(object, this)).ToV8(); 1184 isolate, new RootWebAXObjectProxy(object, this)).ToV8();
1141 if (value_handle.IsEmpty()) 1185 if (value_handle.IsEmpty())
1142 return v8::Handle<v8::Object>(); 1186 return v8::Handle<v8::Object>();
1143 v8::Handle<v8::Object> handle = value_handle->ToObject(isolate); 1187 v8::Handle<v8::Object> handle = value_handle->ToObject(isolate);
1144 elements_.Append(handle); 1188 elements_.Append(handle);
1145 return handle; 1189 return handle;
1146 } 1190 }
1147 1191
1148 } // namespace content 1192 } // namespace content
OLDNEW
« 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