<attachment>s should be created when dropping files onto contentEditable areas
[WebKit-https.git] / LayoutTests / editing / pasteboard / drag-files-to-editable-element.html
index 395e02d193bb911bfbff8004ff700858f06c8317..8c845e187651bac81b44a3694c63a80badc5e1a5 100644 (file)
@@ -7,13 +7,19 @@
 <div id="console"></div>
 <div id="editable" contentEditable=true style="width:200px; height:200px"></div>
 <script>
-description('If we drag files onto an editable area, then the filenames should be inserted into the editable area.');
+description('If we drag files onto an editable area, then attachments should be inserted into the editable area.');
 
 var editable = document.getElementById("editable");
 if (window.eventSender) {
     dragFilesOntoEditable(['foo', 'bar', 'baz']);
-    var result = editable.innerHTML.replace(/file.*?LayoutTests/g, "LayoutTests");
-    shouldBeEqualToString('result', '<div>LayoutTests/editing/pasteboard/foo</div><div>LayoutTests/editing/pasteboard/bar</div><div>LayoutTests/editing/pasteboard/baz</div>');
+    var resultChildren = editable.children;
+    var fileNames = "";
+    for (var i = 0; i < resultChildren.length; i++) {
+        var attachment = resultChildren[i];
+        shouldBeEqualToString('attachment.nodeName', 'ATTACHMENT');
+        fileNames += attachment.file.name + " ";
+    }
+    shouldBeEqualToString('fileNames', 'foo bar baz ');
     editable.innerHTML = '';
 }