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

Unified Diff: LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html

Issue 1049233003: Keep the selection of the text field when changed by JS. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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/fast/events/touch/gesture/gesture-tap-reset-selection-range.html
diff --git a/LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html b/LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html
new file mode 100644
index 0000000000000000000000000000000000000000..761639869eb59255b5245af57c618e7c00608eeb
--- /dev/null
+++ b/LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<script src="../../../../resources/js-test.js"></script>
+<div id="dragme">Make Selection Here</div>
+<script>
+description("This tests if the selection is reset after tapping of gesture");
+
+if (window.eventSender) {
+ var dragme = document.getElementById('dragme');
+ window.getSelection().selectAllChildren(dragme);
+ shouldBeGreaterThan('window.getSelection().rangeCount', '0');
yosin_UTC9 2015/04/10 02:06:09 nit: Please check equality with 1. Seleciton.range
+
+ var x = dragme.offsetLeft + dragme.offsetWidth / 2;
+ var y = dragme.offsetTop + dragme.offsetHeight / 2;
+ eventSender.gestureTapDown(x, y);
+ eventSender.gestureShowPress(x, y);
+ eventSender.gestureTap(x, y);
+ shouldBeZero('window.getSelection().rangeCount');
+}
+</script>

Powered by Google App Engine
This is Rietveld 408576698