blob: cf74382a60660f88a6d5399257ab7000d08847c1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
<!DOCTYPE html>
<body>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../resources/common.js"></script>
<div id="log"></div>
<p>This tests dragging text from an input element into a text area element.</p>
<p>When the test is run, the follow text field should be empty:</p>
<p><input id="input" type="text" value="drag this text into the text area below" size="50"></p>
<p>And the following text area should have text in it:</p>
<p><textarea id="textarea" cols="50" rows="10"></textarea></p>
<script>
if (!window.eventSender)
document.body.textContent = "Require window.eventSender.";
test(function() {
var input = document.getElementById("input");
var textarea = document.getElementById("textarea");
input.select();
hoverOverElement(input);
eventSender.mouseDown();
// Leap the event time so that mouseMove will start a new drag instead of changing selection.
eventSender.leapForward(400);
hoverOverElement(textarea);
eventSender.mouseUp();
assert_equals(input.value, "");
assert_equals(textarea.value, "drag this text into the text area below");
}, "Test to drag INPUT text to TEXTAREA.");
</script>
</body>
|