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

Unified Diff: third_party/WebKit/LayoutTests/accessibility/set-selection-link.html

Issue 2164813003: Fix visible position calculation in accessible setSelection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | third_party/WebKit/Source/core/editing/EditingUtilities.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/accessibility/set-selection-link.html
diff --git a/third_party/WebKit/LayoutTests/accessibility/set-selection-link.html b/third_party/WebKit/LayoutTests/accessibility/set-selection-link.html
new file mode 100644
index 0000000000000000000000000000000000000000..eedc56fa4699058757baa885a423c8bb02f9e081
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/accessibility/set-selection-link.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+
+<div id="main" role="main">
+
+ <p id="para">This<br> is a<a href="#g">test</a>of selection</p>
+
+</div>
+
+<script>
+ test(function()
+ {
+ var axPara = accessibilityController.accessibleElementById("para");
+ var axLastText = axPara.childAtIndex(4);
+ assert_equals(axLastText.role, "AXRole: AXStaticText");
+ assert_equals(axLastText.name, "of selection");
+
+ axLastText.setSelectedTextRange(0, 2);
+
+ var selection = window.getSelection();
+ var range = selection.getRangeAt(0);
David Tseng 2016/07/20 20:39:15 Can we verify the selection data returned by ax (o
+
+ assert_equals(range.toString(), "of");
+ }, "Select text after a link.");
+</script>
+
+<script>
+ if (window.testRunner)
+ document.getElementById("main").style.display = "none";;
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/EditingUtilities.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698