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

Unified Diff: components/test_runner/web_ax_object_proxy.cc

Issue 1336013002: Add test_runner API to set the value of an accessibility object. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 | « components/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: 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))
« no previous file with comments | « components/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