diff options
author | nektar <nektar@chromium.org> | 2015-04-13 12:30:55 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-13 19:31:24 +0000 |
commit | f44560c5afff5572e98cf2e60b738f0abae37604 (patch) | |
tree | 89811fd4587d63748c00bfe746701a75605fdd92 /content | |
parent | 076507a08729c9ad087c2abf16e1a57f3dc18478 (diff) | |
download | chromium_src-f44560c5afff5572e98cf2e60b738f0abae37604.zip chromium_src-f44560c5afff5572e98cf2e60b738f0abae37604.tar.gz chromium_src-f44560c5afff5572e98cf2e60b738f0abae37604.tar.bz2 |
Added selectionStart/EndLineNumber functions in preparation for updating layout tests to stop using insertionPointLineNumber and selectedTextRange functions which are either unwieldy to use or do not provide all the information needed by tests.
BUG=347859
R=dmazzoni
Review URL: https://codereview.chromium.org/1076383003
Cr-Commit-Position: refs/heads/master@{#324897}
Diffstat (limited to 'content')
-rw-r--r-- | content/shell/renderer/test_runner/web_ax_object_proxy.cc | 16 | ||||
-rw-r--r-- | content/shell/renderer/test_runner/web_ax_object_proxy.h | 4 |
2 files changed, 20 insertions, 0 deletions
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 d139fda0..5649602 100644 --- a/content/shell/renderer/test_runner/web_ax_object_proxy.cc +++ b/content/shell/renderer/test_runner/web_ax_object_proxy.cc @@ -488,6 +488,10 @@ WebAXObjectProxy::GetObjectTemplateBuilder(v8::Isolate* isolate) { .SetProperty("childrenCount", &WebAXObjectProxy::ChildrenCount) .SetProperty("selectionStart", &WebAXObjectProxy::SelectionStart) .SetProperty("selectionEnd", &WebAXObjectProxy::SelectionEnd) + .SetProperty("selectionStartLineNumber", + &WebAXObjectProxy::SelectionStartLineNumber) + .SetProperty("selectionEndLineNumber", + &WebAXObjectProxy::SelectionEndLineNumber) .SetProperty("insertionPointLineNumber", &WebAXObjectProxy::InsertionPointLineNumber) .SetProperty("selectedTextRange", &WebAXObjectProxy::SelectedTextRange) @@ -727,6 +731,17 @@ int WebAXObjectProxy::SelectionEnd() { return accessibility_object_.selectionEnd(); } +int WebAXObjectProxy::SelectionStartLineNumber() { + accessibility_object_.updateLayoutAndCheckValidity(); + return accessibility_object_.selectionStartLineNumber(); +} + +int WebAXObjectProxy::SelectionEndLineNumber() { + accessibility_object_.updateLayoutAndCheckValidity(); + return accessibility_object_.selectionEndLineNumber(); +} + +// TODO(nektar): Remove this function after updating tests. int WebAXObjectProxy::InsertionPointLineNumber() { accessibility_object_.updateLayoutAndCheckValidity(); if (!accessibility_object_.isFocused()) @@ -734,6 +749,7 @@ int WebAXObjectProxy::InsertionPointLineNumber() { return accessibility_object_.selectionEndLineNumber(); } +// TODO(nektar): Remove this function after updating tests. std::string WebAXObjectProxy::SelectedTextRange() { accessibility_object_.updateLayoutAndCheckValidity(); unsigned selection_start = accessibility_object_.selectionStart(); diff --git a/content/shell/renderer/test_runner/web_ax_object_proxy.h b/content/shell/renderer/test_runner/web_ax_object_proxy.h index 9a48d49..b734296 100644 --- a/content/shell/renderer/test_runner/web_ax_object_proxy.h +++ b/content/shell/renderer/test_runner/web_ax_object_proxy.h @@ -71,7 +71,11 @@ class WebAXObjectProxy : public gin::Wrappable<WebAXObjectProxy> { int ChildrenCount(); int SelectionStart(); int SelectionEnd(); + int SelectionStartLineNumber(); + int SelectionEndLineNumber(); + // TODO(nektar): Remove this function after updating tests. int InsertionPointLineNumber(); + // TODO(nektar): Remove this function after updating tests. std::string SelectedTextRange(); bool IsEnabled(); bool IsRequired(); |