Index: components/test_runner/web_ax_object_proxy.cc |
diff --git a/components/test_runner/web_ax_object_proxy.cc b/components/test_runner/web_ax_object_proxy.cc |
index 4ed30f2c44ff2f737e8eacd565882a5ad4a9af0c..27786f9d827dd4241a14ce978fae154ff4bd61d1 100644 |
--- a/components/test_runner/web_ax_object_proxy.cc |
+++ b/components/test_runner/web_ax_object_proxy.cc |
@@ -564,6 +564,7 @@ WebAXObjectProxy::GetObjectTemplateBuilder(v8::Isolate* isolate) { |
.SetMethod("decrement", &WebAXObjectProxy::Decrement) |
.SetMethod("showMenu", &WebAXObjectProxy::ShowMenu) |
.SetMethod("press", &WebAXObjectProxy::Press) |
+ .SetMethod("setValue", &WebAXObjectProxy::SetValue) |
.SetMethod("isEqual", &WebAXObjectProxy::IsEqual) |
.SetMethod("setNotificationListener", |
&WebAXObjectProxy::SetNotificationListener) |
@@ -1154,6 +1155,15 @@ void WebAXObjectProxy::Press() { |
accessibility_object_.press(); |
} |
+bool WebAXObjectProxy::SetValue(const std::string& value) { |
+ accessibility_object_.updateLayoutAndCheckValidity(); |
+ if (!accessibility_object_.canSetValueAttribute()) |
+ return false; |
+ |
+ accessibility_object_.setValue(blink::WebString::fromUTF8(value)); |
+ return true; |
+} |
+ |
bool WebAXObjectProxy::IsEqual(v8::Local<v8::Object> proxy) { |
WebAXObjectProxy* unwrapped_proxy = NULL; |
if (!gin::ConvertFromV8(blink::mainThreadIsolate(), proxy, &unwrapped_proxy)) |