3 <script src=
"../../resources/js-test.js"></script>
5 <body onload=
"startTest();">
6 <p id=
"description"></p>
7 <div id=
"console"></div>
8 <div id=
"editable" contentEditable=true
style=
"width:200px; height:200px"></div>
10 description('If we drag files onto an editable area, then the filenames should be inserted into the editable area.');
16 var editable
= document
.getElementById("editable");
17 if (window
.eventSender
) {
18 dragFilesOntoEditable(['foo', 'bar', 'baz']);
19 result
= editable
.innerHTML
.replace(/file.*?LayoutTests/g, "LayoutTests");
20 // FIXME: This test fails and got rebaselinend to expect the failure, we should fix this. See http://crbug.com/443143
21 shouldBeEqualToString('result', '<div>LayoutTests/editing/pasteboard/foo</div><div>LayoutTests/editing/pasteboard/bar</div><div>LayoutTests/editing/pasteboard/baz</div>');
22 editable
.innerHTML
= '';
26 function moveMouseToCenterOfElement(element
)
28 var centerX
= element
.offsetLeft
+ element
.offsetWidth
/ 2;
29 var centerY
= element
.offsetTop
+ element
.offsetHeight
/ 2;
30 eventSender
.mouseMoveTo(centerX
, centerY
);
33 function dragFilesOntoEditable(files
)
35 eventSender
.beginDragWithFiles(files
);
36 moveMouseToCenterOfElement(editable
);
37 eventSender
.mouseUp();
40 var successfullyParsed
= true;