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

Unified Diff: LayoutTests/accessibility/textbox-role-reports-selection.html

Issue 1050123003: Rewrote password layout test and removed obsolete tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Renamed some more tests for consistency. Created 5 years, 8 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/textbox-role-reports-selection.html
diff --git a/LayoutTests/accessibility/textbox-role-reports-selection.html b/LayoutTests/accessibility/textbox-role-reports-selection.html
deleted file mode 100644
index c6ab2ccd56c3d7568e61a1e7e8102d5ec8577a97..0000000000000000000000000000000000000000
--- a/LayoutTests/accessibility/textbox-role-reports-selection.html
+++ /dev/null
@@ -1,54 +0,0 @@
-<!DOCTYPE HTML PUBLIC>
-<html>
-<head>
-<script src="../resources/js-test.js"></script>
-</head>
-<body>
-This tests that the AXSelection property is correctly reported for non-native text boxes.<br>
-<div role="textbox" id="ariaTextBox" aria-multiline="false" tabindex="0">Some text in a textbox (34 chars).</div>
-<div id="console"></div>
-<script>
- function assertEvaluatesTo(actual, expected, message) {
- var actualValue = 0;
- try {
- actualValue = eval(actual);
- } catch (e) {
- debug("Evaluating " + actual + ": Threw exception " + e);
- return;
- }
- if (actualValue === expected)
- debug("PASS: " + actual + " is " + expected + (message ? " (" + message + ")" : ""));
- else
- debug("FAIL: " + actual + " should be " + expected + ", got " + actualValue + (message ? " (" + message + ")" : ""));
- }
-
- function assertCorrectAXSelection(element, selection, message) {
- element.focus();
- var selectionValues = /\{(\d+), (\d+)\}/.exec(selection);
- var selectionStart = eval(selectionValues[1]);
- var selectionLength = eval(selectionValues[2]);
- var selectionEnd = selectionStart + selectionLength;
-
- window.getSelection().setBaseAndExtent(element.firstChild, selectionStart, element.firstChild, selectionEnd);
- var axElement = accessibilityController.focusedElement;
- axSelection = axElement.selectedTextRange;
- assertEvaluatesTo("axSelection", selection, message);
- }
-
- if (window.testRunner && window.accessibilityController) {
- window.testRunner.dumpAsText();
- var ariaTextBox = document.getElementById("ariaTextBox");
- var textLength = ariaTextBox.textContent.length;
-
- assertCorrectAXSelection(ariaTextBox, "{0, 0}", "Collapsed selection at start");
- assertCorrectAXSelection(ariaTextBox, "{" + textLength + ", 0}", "Collapsed selection at end");
- assertCorrectAXSelection(ariaTextBox, "{15, 0}", "Collapsed selection in the middle");
- assertCorrectAXSelection(ariaTextBox, "{15, 2}", "Non-collapsed selection in the middle");
- assertCorrectAXSelection(ariaTextBox, "{0, 15}", "Non-collapsed selection at the start");
- assertCorrectAXSelection(ariaTextBox, "{15, "+ (textLength - 15) + "}", "Non-collapsed selection at the end");
- }
-
-</script>
-
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698