Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / pasteboard / drag-files-to-editable-element.html
blob59ec915a498460ad0fa8e33bfc099e48bdb21f35
1 <html>
2 <head>
3 <script src="../../resources/js-test.js"></script>
4 </head>
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>
9 <script>
10 description('If we drag files onto an editable area, then the filenames should be inserted into the editable area.');
12 var result;
14 function startTest()
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;
41 </script>
42 </body>
43 </html>