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

Unified Diff: LayoutTests/editing/selection/drag-drop-restore.html

Issue 21030005: Editor: Deffer event dispatch after selection change. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | LayoutTests/editing/selection/drag-drop-restore-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/editing/selection/drag-drop-restore.html
diff --git a/LayoutTests/editing/selection/drag-drop-restore.html b/LayoutTests/editing/selection/drag-drop-restore.html
new file mode 100644
index 0000000000000000000000000000000000000000..ca6daa7477a17608b2f3171cbd217e1881c510a6
--- /dev/null
+++ b/LayoutTests/editing/selection/drag-drop-restore.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body onload="runTest()">
+<input type="text" id="src">
+<input type="text" id="dst">
+<script>
+description("This test verifies that content of input box could be restored in 'focus' event fired by drag-and-drop.");
+
+var oldValue = "foo";
+
+function runTest()
+{
+ var src = document.getElementById('src');
+ src.value = "abc";
+ var dst = document.getElementById('dst');
+
+ function restoreValue()
+ {
+ oldValue = src.value;
+ src.value = "abc";
+ }
+ dst.addEventListener("focus", restoreValue, false);
yosin_UTC9 2013/08/26 01:58:55 Please check order of events and action, e.g. sele
+
+ src.select();
+ eventSender.mouseMoveTo(src.offsetLeft + src.offsetWidth / 2, src.offsetTop + src.offsetHeight / 2);
+ eventSender.mouseDown();
+ eventSender.leapForward(100);
+ eventSender.mouseMoveTo(dst.offsetLeft + dst.offsetWidth / 2, dst.offsetTop + dst.offsetHeight / 2);
+ eventSender.mouseUp();
+
+ shouldBeEqualToString("oldValue", "");
+ shouldBeEqualToString("src.value", "abc");
+ shouldBeEqualToString("dst.value", "abc");
+}
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/editing/selection/drag-drop-restore-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698