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

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

Issue 773133009: Introduce new API Language() to test lang attribute that is properly reported. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 2ffc21f0fe98c23030debb9174e72235758a5a06..d7659d10b1280634e2750afdecae58541f16e341 100644
--- a/content/shell/renderer/test_runner/web_ax_object_proxy.cc
+++ b/content/shell/renderer/test_runner/web_ax_object_proxy.cc
@@ -296,6 +296,11 @@ std::string GetValueDescription(const blink::WebAXObject& object) {
return value_description.insert(0, "AXValueDescription: ");
}
+std::string GetLanguage(const blink::WebAXObject& object) {
+ std::string language = object.language().utf8();
+ return language.insert(0, "AXLanguage: ");
+}
+
std::string GetAttributes(const blink::WebAXObject& object) {
// FIXME: Concatenate all attributes of the AXObject.
std::string attributes(GetTitle(object));
@@ -468,6 +473,7 @@ WebAXObjectProxy::GetObjectTemplateBuilder(v8::Isolate* isolate) {
.SetProperty("description", &WebAXObjectProxy::Description)
.SetProperty("helpText", &WebAXObjectProxy::HelpText)
.SetProperty("stringValue", &WebAXObjectProxy::StringValue)
+ .SetProperty("language", &WebAXObjectProxy::Language)
.SetProperty("x", &WebAXObjectProxy::X)
.SetProperty("y", &WebAXObjectProxy::Y)
.SetProperty("width", &WebAXObjectProxy::Width)
@@ -613,6 +619,11 @@ std::string WebAXObjectProxy::StringValue() {
return GetStringValue(accessibility_object_);
}
+std::string WebAXObjectProxy::Language() {
+ accessibility_object_.updateLayoutAndCheckValidity();
+ return GetLanguage(accessibility_object_);
+}
+
int WebAXObjectProxy::X() {
accessibility_object_.updateLayoutAndCheckValidity();
return accessibility_object_.boundingBoxRect().x;
« 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