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

Unified Diff: LayoutTests/editing/selection/readonly-disabled-text-selection.html

Issue 309553007: Adding support for Text Selection on Disabled and Readonly input elements in Android (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed Linux and Windows Layout test breaks. Created 6 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/editing/selection/readonly-disabled-text-selection.html
diff --git a/LayoutTests/editing/selection/readonly-disabled-text-selection.html b/LayoutTests/editing/selection/readonly-disabled-text-selection.html
new file mode 100644
index 0000000000000000000000000000000000000000..805c5bd8c2a3da9e528a31d6ad2d9a5783d7cc13
--- /dev/null
+++ b/LayoutTests/editing/selection/readonly-disabled-text-selection.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<script src="../../resources/js-test.js"></script>
+<script>
+onload = function() {
+ if (!window.eventSender || !window.eventSender.gestureLongPress) {
+ debug("gestureLongPress not implemented by this platform.");
+ debug("Manullay long press on every element in the page and check whether Text selection is happening or not");
+ debug("If Text selection is not happening for readonly or disabled input/textarea, then it's a failure.");
+ return;
+ }
+
+ doLongPressOnElement("normalText");
+
+ doLongPressOnElement("readOnlyText");
+
+ doLongPressOnElement("disabledText");
+
+ doLongPressOnElement("readOnlyDisabledText");
+
+ doLongPressOnElement("normalTextArea");
+
+ doLongPressOnElement("readOnlyTextArea");
+
+ doLongPressOnElement("disabledTextArea");
+
+ doLongPressOnElement("readOnlyDisabledTextArea");
+}
+
+function doLongPressOnElement(elementId) {
+ var element = document.getElementById(elementId);
+ var bounds = element.getBoundingClientRect();
+ var middleX = (bounds.left + bounds.right) / 2;
+ var middleY = (bounds.top + bounds.bottom) / 2;
+ // Touch directly in the center of the element.
+ window.eventSender.gestureLongPress(middleX, middleY);
+ shouldBeEqualToString('window.getSelection().toString()', element.value);
+}
+</script>
+<input id="normalText" type="text" value="NormalInput">
+<input id="readOnlyText" type="text" value="ReadonlyInput" readonly>
+<input id="disabledText" type="text" value="DisabledInput" disabled>
+<input id="readOnlyDisabledText" size="20" type="text" value="ReadonlyDisabledInput"readonly disabled>
+<textarea id="normalTextArea" cols="31">NormalTextarea</textarea>
+<textarea id="readOnlyTextArea" cols="31" readonly>ReadonlyTextarea</textarea>
+<textarea id="disabledTextArea" cols="31" disabled>DisabledTextarea</textarea>
+<textarea id="readOnlyDisabledTextArea" cols="31" readonly disabled>ReadonlyDisabledTextarea</textarea>
+
« no previous file with comments | « LayoutTests/NeverFixTests ('k') | LayoutTests/editing/selection/readonly-disabled-text-selection-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698