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

Unified Diff: LayoutTests/accessibility/inline-text-changes.html

Issue 23983002: Expose InlineTextBoxes in the accessibility tree. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 7 years, 2 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
Index: LayoutTests/accessibility/inline-text-changes.html
diff --git a/LayoutTests/accessibility/inline-text-changes.html b/LayoutTests/accessibility/inline-text-changes.html
new file mode 100644
index 0000000000000000000000000000000000000000..ca575a20d95b0bfbfc9274ea4938aa05b9f10bdc
--- /dev/null
+++ b/LayoutTests/accessibility/inline-text-changes.html
@@ -0,0 +1,49 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+
+<p id="p" style="width: 10em;">
+ This paragraph contains two lines of text.
+</p>
+
+<p id="description"></p>
+<pre id="tree"></pre>
+<div id="console"></div>
+
+<script>
+
+ description("Tests that accessible inline text boxes update immediately when a static text element changes.");
+
+ if (window.accessibilityController) {
+ window.axParagraph = accessibilityController.accessibleElementById('p');
+ window.axStaticText = axParagraph.childAtIndex(0);
+ shouldBe("axStaticText.childrenCount", "2");
+
+ window.axInlineBefore0 = axStaticText.childAtIndex(0);
+ shouldBe("axInlineBefore0.stringValue", "'AXValue: This paragraph contains '");
+ window.axInlineBefore1 = axStaticText.childAtIndex(1);
+ shouldBe("axInlineBefore1.stringValue", "'AXValue: two lines of text.'");
+
+ // Modify the text.
+ document.getElementById("p").innerText += ' One more sentence.';
+
+ // Make sure the inline text boxes changed.
+ shouldBe("axStaticText.childrenCount", "3");
+ window.axInlineAfter0 = axStaticText.childAtIndex(0);
+ shouldBe("axInlineAfter0.stringValue", "'AXValue: This paragraph contains '");
+ window.axInlineAfter1 = axStaticText.childAtIndex(1);
+ shouldBe("axInlineAfter1.stringValue", "'AXValue: two lines of text. One '");
+ window.axInlineAfter2 = axStaticText.childAtIndex(2);
+ shouldBe("axInlineAfter2.stringValue", "'AXValue: more sentence.'");
+
+ // Make sure the old object pointing to the second text box is no longer valid.
+ shouldBe("axInlineBefore1.stringValue", "'AXValue: '");
+ }
+</script>
+
+<script src="../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698