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

Side by Side Diff: content/shell/test_runner/web_ax_object_proxy.cc

Issue 2694903010: AX checked state changes (Closed)
Patch Set: Test checkbox attribute in automation API, fix whitespace, remove change to third party code Created 3 years, 9 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
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/test_runner/web_ax_object_proxy.h" 5 #include "content/shell/test_runner/web_ax_object_proxy.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 return accessibility_object_.isSelectedOptionActive(); 994 return accessibility_object_.isSelectedOptionActive();
995 } 995 }
996 996
997 bool WebAXObjectProxy::IsExpanded() { 997 bool WebAXObjectProxy::IsExpanded() {
998 accessibility_object_.updateLayoutAndCheckValidity(); 998 accessibility_object_.updateLayoutAndCheckValidity();
999 return accessibility_object_.isExpanded() == blink::WebAXExpandedExpanded; 999 return accessibility_object_.isExpanded() == blink::WebAXExpandedExpanded;
1000 } 1000 }
1001 1001
1002 bool WebAXObjectProxy::IsChecked() { 1002 bool WebAXObjectProxy::IsChecked() {
1003 accessibility_object_.updateLayoutAndCheckValidity(); 1003 accessibility_object_.updateLayoutAndCheckValidity();
1004 return accessibility_object_.isChecked(); 1004 return accessibility_object_.checkedState() != blink::WebAXCheckedFalse;
1005 } 1005 }
1006 1006
1007 bool WebAXObjectProxy::IsCollapsed() { 1007 bool WebAXObjectProxy::IsCollapsed() {
1008 accessibility_object_.updateLayoutAndCheckValidity(); 1008 accessibility_object_.updateLayoutAndCheckValidity();
1009 return accessibility_object_.isExpanded() == blink::WebAXExpandedCollapsed; 1009 return accessibility_object_.isExpanded() == blink::WebAXExpandedCollapsed;
1010 } 1010 }
1011 1011
1012 bool WebAXObjectProxy::IsVisible() { 1012 bool WebAXObjectProxy::IsVisible() {
1013 accessibility_object_.updateLayoutAndCheckValidity(); 1013 accessibility_object_.updateLayoutAndCheckValidity();
1014 return accessibility_object_.isVisible(); 1014 return accessibility_object_.isVisible();
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1120 return static_cast<int32_t>(headers.size()); 1120 return static_cast<int32_t>(headers.size());
1121 } 1121 }
1122 1122
1123 bool WebAXObjectProxy::IsClickable() { 1123 bool WebAXObjectProxy::IsClickable() {
1124 accessibility_object_.updateLayoutAndCheckValidity(); 1124 accessibility_object_.updateLayoutAndCheckValidity();
1125 return accessibility_object_.isClickable(); 1125 return accessibility_object_.isClickable();
1126 } 1126 }
1127 1127
1128 bool WebAXObjectProxy::IsButtonStateMixed() { 1128 bool WebAXObjectProxy::IsButtonStateMixed() {
1129 accessibility_object_.updateLayoutAndCheckValidity(); 1129 accessibility_object_.updateLayoutAndCheckValidity();
1130 return accessibility_object_.isButtonStateMixed(); 1130 return accessibility_object_.checkedState() == blink::WebAXCheckedMixed;
1131 } 1131 }
1132 1132
1133 v8::Local<v8::Object> WebAXObjectProxy::AriaControlsElementAtIndex( 1133 v8::Local<v8::Object> WebAXObjectProxy::AriaControlsElementAtIndex(
1134 unsigned index) { 1134 unsigned index) {
1135 accessibility_object_.updateLayoutAndCheckValidity(); 1135 accessibility_object_.updateLayoutAndCheckValidity();
1136 SparseAttributeAdapter attribute_adapter; 1136 SparseAttributeAdapter attribute_adapter;
1137 accessibility_object_.getSparseAXAttributes(attribute_adapter); 1137 accessibility_object_.getSparseAXAttributes(attribute_adapter);
1138 blink::WebVector<blink::WebAXObject> elements = 1138 blink::WebVector<blink::WebAXObject> elements =
1139 attribute_adapter.object_vector_attributes 1139 attribute_adapter.object_vector_attributes
1140 [blink::WebAXObjectVectorAttribute::AriaControls]; 1140 [blink::WebAXObjectVectorAttribute::AriaControls];
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
1748 v8::Local<v8::Value> value_handle = 1748 v8::Local<v8::Value> value_handle =
1749 gin::CreateHandle(isolate, new WebAXObjectProxy(object, this)).ToV8(); 1749 gin::CreateHandle(isolate, new WebAXObjectProxy(object, this)).ToV8();
1750 if (value_handle.IsEmpty()) 1750 if (value_handle.IsEmpty())
1751 return v8::Local<v8::Object>(); 1751 return v8::Local<v8::Object>();
1752 v8::Local<v8::Object> handle = value_handle->ToObject(isolate); 1752 v8::Local<v8::Object> handle = value_handle->ToObject(isolate);
1753 elements_.Append(handle); 1753 elements_.Append(handle);
1754 return handle; 1754 return handle;
1755 } 1755 }
1756 1756
1757 } // namespace test_runner 1757 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698